Combine sumproduct with IF

alyssa75

Board Regular
Joined
May 14, 2007
Messages
240
Formula currently is something like:

Sumproduct(b1:b100,c1:c100) to get the aggregate of (b1*c1)+(b2+c2)+.....etc


How can I add a condition to only perform include in formula if D = something.

So needing a simplified version of the following longhand formula:

if(D1 = a35,b1*c1,0)+if(D2=a35,b2*c2,0)+...etc...all the way through the end of the range. say row 100.

Any ideas?

Thanks!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi, how would the formula if there were multiple if-conditions that had to be met? something that in a perfect world would be called SUMPRODUCTIFS?

Thanks,

JRudner
 
Upvote 0
Do you mean multiple conditions in separate columns? You can just add conditions, e.g.

to count rows where column A = "x" and column B = "y"

=SUMPRODUCT(--(A$2:A$100="x"),--(B$2:B$100="y"))

or to sum column C when the same 2 conditions are met

=SUMPRODUCT(--(A$2:A$100="x"),--(B$2:B$100="y"),C$2:C100)

....add more conditions by adding more instances like --(A$2:A$100="x") separated by commas
 
Upvote 0
Yes, I believe... This is what I have now:
=SUMPRODUCT(('Timecard Detail FY16'!E2:E7601,M3)*(--(MONTH('Timecard Detail FY16'!H2:H7601)=10))*('Timecard Detail FY16'!M2:M7601))

But I a get a #VALUE! error.
 
Upvote 0
I am not an expert like many in this forum, but the "M3" might be the problem. I do not see how that fits into the syntax of SUMPRODUCT.
 
Upvote 0
Probably

=SUMPRODUCT(--('Timecard Detail FY16'!E2:E7601=M3),--(MONTH('Timecard Detail FY16'!H2:H7601)=10),'Timecard Detail FY16'!M2:M7601)
 
Upvote 0
M3 is the reference cell (IRL) the cell reference the list of names. So for example M3=John; M4;Bob, etc.
 
Upvote 0

Forum statistics

Threads
1,216,031
Messages
6,128,424
Members
449,450
Latest member
gunars

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