Hi,
Considering this formula:
What does -- sign stands for?![]()
=SUMPRODUCT(--(B4:D4=0);--E4:G4;--H4:J4)
Thanks in advance.
Best regards.
John
Hi,
Considering this formula:
What does -- sign stands for?![]()
=SUMPRODUCT(--(B4:D4=0);--E4:G4;--H4:J4)
Thanks in advance.
Best regards.
John
Hello John, a "test" like B4:D4=0 returns an "array" of TRUE/FALSE values, e.g.
{TRUE,FALSE,TRUE}
when you use -- in front of that it "co-erces" the FALSE values to zero and the TRUE values to 1 so you get
{1,0,1}
SUMPRODUCT can then use those numeric values
You can use other "co-ercers" like +0 or *1
Note: in your formula, with numbers in E4:J4 you don't need -- for those, i.e. this formula should work
=SUMPRODUCT(--(B4:D4=0);E4:G4;H4:J4)
Audere est facere
Hello,
Yes, it works the other way too. Thank you for clarifying this out.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks