PDA

View Full Version : Sumproduct across ranges with varying sum values



plasteredric
10-02-2017, 04:00 PM
Hi, have a difficult problem to explain. Trying to put a formula together (similar to a sumproduct formula) that multiplies each row of an array with a value that is assigned to the cell on the same row.

I've included the sample sheet as that explains it better.

Thanks
20551

Bob Phillips
10-03-2017, 12:54 AM
Try this array formula

=SUM(IF($E$9:$E$14=G3,$C$9:$C$14))

Bob Phillips
10-03-2017, 12:55 AM
Or even

=SUMPRODUCT(--($E$9:$E$14=G3),$C$9:$C$14)

plasteredric
10-03-2017, 03:10 AM
Sorry i probably didn't explain myself very clearly. I've revised the attached sheet to show the calculation steps involved.
I would rather not have a results column next to each selection, if there is a formula I can put in the totals cells that will work it all out that would be fantastic

20553

Bob Phillips
10-03-2017, 05:01 AM
If you can sort the first table into Type order, this array formula should work

=SUM(IF(G3=$E$9:$E$14,LOOKUP($F$9:$F$14,$D$3:$E$6)*$C$9:$C$14))

The array formula is entered by pressing the keyboard combination

Ctrl
+
Shift
+
Enter