10 January 2019
In more advanced Excel formulas, you might run into the double negative operation (--
).
The double negative (sometimes called the even more nerdy "double unary") coerces TRUE
or FALSE
values to their numeric equivalents, 1
and 0
. It's used in formulas where numbers are needed for a particular math operation.
A double negative is not the only way to get ones and zeros from logicals. You can also add or subtract zero, multiply by one, or use the inscrutably named N
function.
Full article: The double negative in Excel formulas