Add a condition to a SUMPRODUCT formula

Fin Fang Foom

Well-known Member
Joined
Mar 20, 2005
Messages
598
Well I have another problem. I would like add a condition to this formula to look for a paticular machine. So I convert this formula:

=SUMPRODUCT((B3:B7+D3:D7),(B3:B7+D3:D7)/C3:C7)/(SUM(B3:B7)+SUM(D3:D7))

into this

=SUMPRODUCT((A$3:A$30=E3)*(B$3:$B$30+$D$3:$D$30),($B$3:$B$30+$D$3:$D$30)/$C$3:$C$30)/(SUM($B$3:$B$30)+SUM($D$3:$D$30))

But it did not work.

Any Ideas?
 
Try...

=SUM(IF($A$3:$A$19=E3,($B$3:$B$19+$D$3:$D$19)*($B$3:$B$19+$D$3:$D$19)/IF($C$3:$C$19>0,$C$3:$C$19,1)))/SUM(IF($A$3:$A$19=E3,$B$3:$B$19+$D$3:$D$19))

...confirmed with CONTROL+SHIFT+ENTER. You'll notice that I adopted Aladin's formula, using SUM(IF(...)) instead of two SUMIF's at the end of the formula. I guess it must be more efficient. As usual, I follow his lead... :wink:

Hope this helps!
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try...

=SUM(IF($A$3:$A$19=E3,($B$3:$B$19+$D$3:$D$19)*($B$3:$B$19+$D$3:$D$19)/IF($C$3:$C$19>0,$C$3:$C$19,1)))/SUM(IF($A$3:$A$19=E3,$B$3:$B$19+$D$3:$D$19))

...confirmed with CONTROL+SHIFT+ENTER. You'll notice that I adopted Aladin's formula, using SUM(IF(...)) instead of two SUMIF's at the end of the formula. I guess it must be more efficient. As usual, I follow his lead... :wink:

Hope this helps!


Perfect Thank You so much!!
 
Upvote 0

Forum statistics

Threads
1,216,181
Messages
6,129,355
Members
449,506
Latest member
nomvula

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