Meaning of "--" in formulas

  • Thread starter Thread starter JoAnn
  • Start date Start date
J

JoAnn

I sometimes see formulas with -- before a set of parenthesis (sample formula
below), can anyone tell me what the purpose of it is? I can't seem to find
it documented anywhere.

For example:
=SUMPRODUCT(--(MONTH(b7:b400)=MONTH(D417)), --(YEAR(b7:b400)=YEAR(D417))

Thanks
 
Hi JoAnn

The -- stuff changes trues and falses
to 1's and 0's. Logic expression to numeric expression.
Regards
Cimjet
 
Hi JoAnn
Further to Cimjets answer.
The -- is called a Double Unary and the simple way to see Cimjets answer is
to take them out of the formula and see the result in the formula bar.
It will refer to True or false rather than a mathematical result

Regards
Michael M
 
Back
Top