Sumproduct if match

icytuvi

New Member
Joined
Feb 2, 2020
Messages
22
Office Version
  1. 2013
Platform
  1. Windows
Hello there,

I have a excel problem that I need your support in solving this.

- We have products using paint mixture which have blending ratio change over seasons (summer & winter) (table 1)
- The unit cost of paints are given by month corresponding to specific season (table 2).
- Now to calculate the cost of product (table 3)

Could you please suggest if there is any formula that help me not to do the multiplication manually one by one?

Sample.xlsx
ABCDEFGHIJKLM
2Table 1: Color blending ratio of products
3Blending %WinterSummer
4RedYellowGreenRedYellowGreen
5Product 125%30%45%50%30%20%
6Product 230%28%43%55%28%18%
7Product 335%25%40%60%25%15%
8Product 440%23%38%65%23%13%
9Product 545%20%35%70%20%10%
10Product 650%18%33%75%18%7%
11
12Table 2: Cost of paint
13Unit costWinterWinterWinterSummerSummerSummerSummerSummerSummerWinterWinterWinter
14JanFebMarAprMayJunJulAugSepOctNovDec
15Red50556065707567.56052.54537.530
16Yellow20253035404537.53022.5157.50
17Green30354045505547.54032.52517.510
18
19Table 3: To calculate cost of products
20Cost AmountWinterWinterWinterSummerSummerSummerSummerSummerSummerWinterWinterWinter
21JanFebMarAprMayJunJulAugSepOctNovDec
22Product 132
23Product 2
24Product 3
25Product 4
26Product 5
27Product 6
Sheet1
Cell Formulas
RangeFormula
B22B22=B5*B15+C5*B16+D5*B17
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
I have solved the problem with the formula below, but would appreciate any suggestions if the product not only consist of 03 colors such as Red, Yellow and Green but a dozen.

Thanks.

Sample.xlsx
ABCDEFGHIJKLM
19Table 3: To calculate cost of products
20Cost AmountWinterWinterWinterSummerSummerSummerSummerSummerSummerWinterWinterWinter
21JanFebMarAprMayJunJulAugSepOctNovDec
22Product 132374252576254.54739.52719.512
23Product 233.2538.2543.2553.2558.2563.2555.7548.2540.7528.2520.7513.25
24Product 334.539.544.554.559.564.55749.54229.52214.5
25Product 435.7540.7545.7555.7560.7565.7558.2550.7543.2530.7523.2515.75
26Product 537424757626759.55244.53224.517
27Product 638.2543.2548.2558.2563.2568.2560.7553.2545.7533.2525.7518.25
Sheet1
Cell Formulas
RangeFormula
B22:M27B22=SUMPRODUCT(($A$15:$A$17="Red")*($B$14:$M$14=B$21)*($B$15:$M$17)*1)*SUMPRODUCT(($B$3:$G$3=B$20)*($B$4:$G$4="Red")*($A$5:$A$10=$A22)*($B$5:$G$10)*1)+SUMPRODUCT(($A$15:$A$17="Yellow")*($B$14:$M$14=B$21)*($B$15:$M$17)*1)*SUMPRODUCT(($B$3:$G$3=B$20)*($B$4:$G$4="Yellow")*($A$5:$A$10=$A22)*($B$5:$G$10)*1)+SUMPRODUCT(($A$15:$A$17="Green")*($B$14:$M$14=B$21)*($B$15:$M$17)*1)*SUMPRODUCT(($B$3:$G$3=B$20)*($B$4:$G$4="Green")*($A$5:$A$10=$A22)*($B$5:$G$10)*1)
 
Upvote 0
Consider this

Book1
ABCDEFGHIJKLM
1Table 1: Color blending ratio of products
2Blending %WinterWinterWinterSummerSummerSummer
3RedYellowGreenRedYellowGreen
4Product 10.250.30.450.50.30.2
5Product 20.30.2750.4250.550.2750.175
6Product 30.350.250.40.60.250.15
7Product 40.40.2250.3750.650.2250.125
8Product 50.450.20.350.70.21.00E-01
9Product 60.50.1750.3250.750.1757.50E-02
10
11Table 2: Cost of paint
12Unit costWinterWinterWinterSummerSummerSummerSummerSummerSummerWinterWinterWinter
13JanFebMarAprMayJunJulAugSepOctNovDec
14Red50556065707567.56052.54537.530
15Yellow20253035404537.53022.5157.50
16Green30354045505547.54032.52517.510
17
18Table 3: To calculate cost of products
19Cost AmountWinterWinterWinterSummerSummerSummerSummerSummerSummerWinterWinterWinter
20JanFebMarAprMayJunJulAugSepOctNovDec
21Product 132374252576254.54739.52719.512
22Product 233.2538.2543.2553.2558.2563.2555.7548.2540.7528.2520.7513.25
23Product 334.539.544.554.559.564.55749.54229.52214.5
24Product 435.7540.7545.7555.7560.7565.7558.2550.7543.2530.7523.2515.75
25Product 537424757626759.55244.53224.517
26Product 638.2543.2548.2558.2563.2568.2560.7553.2545.7533.2525.7518.25
Sheet1
Cell Formulas
RangeFormula
B21:M26B21=SUM(TRANSPOSE(IF($B$2:$G$2=B$19,INDEX($B$4:$G$9,MATCH($A21,$A$4:$A$9,0),0)))*INDEX(INDEX($B$14:$M$16,,MATCH(B$20,$B$13:$M$13,0)),{1;2;3;1;2;3}))
 
Upvote 0
if you have more colours (say if you have 4 colour just edit {1;2;3;1;2;3} to {1;2;3;4;1;2;3;4})

also the colour combination needs to be in sequence in both columns and rows i.e. RED, Yellow & Green. If it is changed in A14:16 then B3:D3 should also change in that order
 
Upvote 0
if you have more colours (say if you have 4 colour just edit {1;2;3;1;2;3} to {1;2;3;4;1;2;3;4})

also the colour combination needs to be in sequence in both columns and rows i.e. RED, Yellow & Green. If it is changed in A14:16 then B3:D3 should also change in that order
Thanks a lot. This formula helps save me a lot of time typing :D

Still I am seeking a more flexible solution if possible, as at times I will not be able to arrange the information in sequence and will need to identify the matching info among tons of those.
 
Upvote 0
Book1
ABCDEFGHIJKLM
1Table 1: Color blending ratio of products
2Blending %WinterWinterWinterSummerSummerSummer
3RedYellowGreenRedYellowGreen
4Product 10.250.30.450.50.30.2
5Product 20.30.2750.4250.550.2750.175
6Product 30.350.250.40.60.250.15
7Product 40.40.2250.3750.650.2250.125
8Product 50.450.20.350.70.2 0.10
9Product 60.50.1750.3250.750.175 0.07
10
11Table 2: Cost of paint
12Unit costWinterWinterWinterSummerSummerSummerSummerSummerSummerWinterWinterWinter
13JanFebMarAprMayJunJulAugSepOctNovDec
14Red50556065707567.56052.54537.530
15Yellow20253035404537.53022.5157.50
16Green30354045505547.54032.52517.510
17
18Table 3: To calculate cost of products
19Cost AmountWinterWinterWinterSummerSummerSummerSummerSummerSummerWinterWinterWinter
20JanFebMarAprMayJunJulAugSepOctNovDec
21Product 132374252576254.54739.52719.512
22Product 233.2538.2543.2553.2558.2563.2555.7548.2540.7528.2520.7513.25
23Product 334.539.544.554.559.564.55749.54229.52214.5
24Product 435.7540.7545.7555.7560.7565.7558.2550.7543.2530.7523.2515.75
25Product 537424757626759.55244.53224.517
26Product 638.2543.2548.2558.2563.2568.2560.7553.2545.7533.2525.7518.25
Sheet1
Cell Formulas
RangeFormula
B21:M26B21=SUM(INDEX(INDEX(IF(B$19=$B$2:$G$2,$B$4:$G$9),ROW($A$4:$A$9)-ROW($A$4)+1,MATCH(TRANSPOSE($A$14:$A$16),IF(B$19=$B$2:$G$2,$B$3:$G$3),0)),MATCH($A21,$A$4:$A$9,0))*TRANSPOSE(INDEX($B$14:$M$16,,MATCH(B$20,$B$13:$M$13,0))))
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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