What is the "--" (double dash) in MS Excel formula?
"Alfred" wrote:
I would like to know the meaning of "--" (double dash)
in the below Excel formula:
[....]
MATCH(0,--(MMULT(--(ROW(OFFSET(....
MATCH(0,--(MMULT(--(ROW(OFFSET(....
It is simply double-negation. As you might know, -5 is negative 5. --5 is
negative negative 5, which is simply 5.
Normally, double-negation is needed to convert non-numeric values to numeric
values. Any idempotent arithmetic operation will work; for example,
multiplying by 1 instead of using double-negation. (But I prefer
double-negation.)
I have not completely parsed the formula that you provided. But my guess
is, the double-negative is used in the following context:
--(something=something)
In that context, we are converting the (array of?) logical value(s) TRUE and
FALSE to 1 and 0, which might be needed for the MATCH expression to work
properly.
|