Conditional SUMPRODUCT where condition is met in any of multiple columns

brennanstephenson

New Member
Joined
Jan 14, 2017
Messages
5
I'm currently using the following formula for a weighted average to great success:

=SUMPRODUCT(--($V$3:$V$200=$Z5),G$3:G$200,$P$3:$P$200)/(SUMIF($V$3:$V$200,$Z5,$P$3:$P$200))

where the bold criteria is something I need to alter for another weighted average.

My problem is that the set of criteria for the new weighted average could match in any of 5 consecutive columns (matching the same Z5). I tried to change the V3:V200 to A3:E200, but SUMPRODUCT didn't seem to be a fan of that.

How can I approach this? I feel a boolean route might work, but I'm drawing circles in my head...

IF A3:A200=Z5 OR B3:B200=Z5 OR C3:C200=Z5 etc etc


Thanks for the help! I'm happy to clarify if needed!
 
No Dice. I'm getting #DIV/0 when the criteria is not met (which is consistent with other uses in the sheet, hence the IFERROR wrapping), and a #VALUE! when the criteria is met.

Does this...

=IFERROR(SUMPRODUCT(--('January Data'!$V$3:$V$200=$B5),'January Data'!G$3:G$200,'January Data'!$P$3:$P$200)/(SUMIF('January Data'!$V$3:$V$200,$B5,'January Data'!$P$3:$P$200)),"-=-")

work?
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,223,948
Messages
6,175,580
Members
452,653
Latest member
craigje92

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