Sumproduct question (I think)

Bob White

Board Regular
Joined
May 4, 2008
Messages
61
Hello Experts

In the attached table SKUs 1,5 and 7 all contain blue.

I want a function that will look up the quantity of each SKU that contains Blue in Table 2 (e.g. SKU 1 =55, SKU 5 =67 and SKU 7 =73) and then multiply and sum each of the quantities by the numbers in the column "Amount 1 per unit" and Amount 2 per unit" in Table 1.

In this example the function will return the 42,263 which equals Blue = SKU 1 (55 x 2x 23) + SKU 5 (67 x 6 x 63) + SKU 7 (8 x 8 x73)

TABLE 1
SKU
Colour
Amount 1 per unit
Amount 2 per unit
SKU 1
blue
2
23
SKU 2
red
3
21
SKU 3
green
4
45
SKU 4
yellow
5
41
SKU 5
blue
6
63
SKU 6
red
7
24
SKU 7
blue
8
8
TABLE 2
SKU
QTY
Colour
TOTAL QTY
SKU 1
55
blue
42,263
SKU 2
58
SKU 3
61
Blue = SKU 1 (55 x 2x 23) + SKU 5 (67 x 6 x 63) + SKU 7 (8 x 8 x73)
SKU 4
64
SKU 5
67
SKU 6
70
SKU 7
73

<tbody>
</tbody>
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Here is one option, note: I get the same result as Marcelo suggests..


Excel 2013/2016
ABCDE
1TABLE 1
2SKUColourAmount 1 per unitAmount 2 per unit
3SKU 1blue223
4SKU 2red321
5SKU 3green445
6SKU 4yellow541
7SKU 5blue663
8SKU 6red724
9SKU 7blue88
10
11
12TABLE 2
13SKUQTYColourTOTAL QTY
14SKU 155blue32528
15SKU 258
16SKU 361
17SKU 464
18SKU 567
19SKU 670
20SKU 773
Sheet1
Cell Formulas
RangeFormula
E14=SUMPRODUCT(--(B3:B9=D14),C3:C9,D3:D9,SUMIFS(B14:B20,A14:A20,A3:A9))
 
Upvote 0
If the SKUs are in the same order in both tables you also can try (using data layout provided by FormR)
=SUMPRODUCT(--(B$3:B$9=D14),C$3:C$9,D$3:D$9,B$14:B$20)

M.
 
Last edited:
Upvote 0
Thanks you have been a great help.

What is the purpose of the "-- " after the first bracket in the equation?
 
Upvote 0

Forum statistics

Threads
1,215,553
Messages
6,125,483
Members
449,233
Latest member
Deardevil

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