What does — (minus minus) do in Excel? [duplicate]

2019-09-19 12:41发布

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 ;)

1条回答
三岁会撩人
2楼-- · 2019-09-19 13:15

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.

查看更多
登录 后发表回答