sumproduct Meaning "(--"

further

New Member
Joined
Mar 26, 2012
Messages
1
I have found a sumproduct formula and need to understand what it is doing?

sumproduct (--($v9:$v90=A28),$AA9:$AA90,AG9:AG90)

I understand a normal sumproduct but what is the "(--" doing?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Maybe someone can give a more detailed answer, but I believe that it changes the values in the array from True/False statements to 1's and 0's so that the formula can calculate the total.
 
Upvote 0
Welcome to the board..

It's creating an array of 1's and 0's
Based on the results of the expression.
(V9:V90=A28) <- this is an expression that returns either True or False
One true/false result for each cell in the range.
The -- coerces True to 1, False to 0
 
Upvote 0
I have found a sumproduct formula and need to understand what it is doing?

sumproduct (--($v9:$v90=A28),$AA9:$AA90,AG9:AG90)

I understand a normal sumproduct but what is the "(--" doing?


It is essentially the same as saying SumProductIf which doesn't exist, so SumProduct If the statement is true.

e.g.

=((SUMPRODUCT(--(A16:A25="Y"),B16:B25,C16:C25))

In this example if the values in column A contain a "Y", then SumProduct their respective rows in columns B and C, otherwise don't sum them.

Really useful formula!
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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