This question already has an answer here:
In Excel I have two cells
A1 Gwen Stefani
B1 =SUMPRODUCT(--(A1:A10="Gwen Stefani"))
B1 records a value of 1 (it counts "Gwen Stefani" in cell A1)
My question is this: What is the -- operator called, for want of a better word, and what does it do?
- Naturally looking up "--" in Excel help gets me 50,200 results of - which isn't helpful ;)
The (A1:A10="Gwen Stefani") evaluates to an array (TRUE, FALSE, FALSE, FALSE...). So you are multiplying it by 1 to get (1,0,0,...). The "- -" can be replaced by "1*" with the same result.