SumProduct Question

ciavala

Board Regular
Joined
Dec 7, 2003
Messages
223
Office Version
  1. 2010
Platform
  1. Windows
In one of the posts a reference was made to go here for further explaination about SumProduct:

http://www.xldynamic.com/source/xld.SUMPRODUCT.html

At this site there is a formula

=SUMPRODUCT(--(A1:A4="x"),(B1:B4))

The formula does not work without the two dashes before parenthesis.

Finally the question, what are the dashes, and how does it make this formula work?


ciavala
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
In one of the posts a reference was made to go here for further explaination about SumProduct:

http://www.xldynamic.com/source/xld.SUMPRODUCT.html

At this site there is a formula

=SUMPRODUCT(--(A1:A4="x"),(B1:B4))

The formula does not work without the two dashes before parenthesis.

Finally the question, what are the dashes, and how does it make this formula work?


ciavala

I presume that this formula has been used as an example. In fact, whenever you have a single condition, SumIf for summing (and CountIf for counting) should be used:

=SUMIF(A1:A4,"x",B1:B4)

Double negation is invoked in order to satisfy the SumProduct requirement that the arrays it is fed with are all numeric... For more, see:

http://www.mrexcel.com/board2/viewtopic.php?t=133602
 
Upvote 0
Thanks Aladin.

Yes this was an example comparing SumProduct with SumIf and CountIf.

Thanks again.
ciavala
 
Upvote 0
Researching the SumProduct and the double dashes further if anyone really cares about this unexciting trivial bit of information, the proper terminology for the dashes are:

double unary operator or double unary - - notation


Yes, I agree, that is some stimulating FYI there.


ciavala
 
Upvote 0
Researching the SumProduct and the double dashes further if anyone really cares about this unexciting trivial bit of information, the proper terminology for the dashes are:

double unary operator or double unary - - notation


Yes, I agree, that is some stimulating FYI there.


ciavala

Hope you didn't conclude that "double negation" is inappropriate...
 
Upvote 0
Not at all Aladin. I'm not a nomenclature geek, but I know some people are, so I was trying to pass on the info.
You have always been a big help to me when I've needed help on this board - won't see me trying to step on your toes.

Thanks again.
ciavala
 
Upvote 0

Forum statistics

Threads
1,215,011
Messages
6,122,677
Members
449,092
Latest member
tayo4dgacorbanget

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top