SUMPRODUCT with multiple criteria

jordiCT

New Member
Joined
Jul 19, 2018
Messages
3
I have two set of tables:
1) In the first table I have a series of percentages associated each with a code (e.g. C2, C18, C20):
C2C18C20C12C5C6
20%16%20%5%4%12%

<tbody>
</tbody>

2) In the second table I have values associated with the same codes as in the first table (i.e. C2, C18, etc):
C2C12C6C3C9C18C5C20
100234251727153050

<tbody>
</tbody>

What I would like to do is to multiply the percentage values in Table 1 by the values in Table 2 that are associated with the same Cx code and sum them all (i.e. 20%*100+16%*15+20%*50, etc.).

I have tried using sumproduct and sumproduct with INDEX MATCH but could not make it work...

Many thanks!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Welcome to Mr Excel forum

Assuming your data like this

Sheet1

A
B
C
D
E
F
1
C2​
C18​
C20​
C12​
C5​
C6​
2
20%​
16%​
20%​
5%​
4%​
12%​

<tbody>
</tbody>


Sheet2

A
B
C
D
E
F
G
H
I
J
1
C2​
C12​
C6​
C3​
C9​
C18​
C5​
C20​
Result​
2
100​
234​
25​
17​
27​
15​
30​
50​
48,3​

<tbody>
</tbody>


Formula in J2
=SUMPRODUCT(SUMIF(Sheet1!A1:F1,A1:H1,Sheet1!A2:F2)*A2:H2)

Hope this helps

M.
 
Last edited:
Upvote 0
Welcome to Mr Excel forum

Assuming your data like this

Sheet1

A
B
C
D
E
F
1
C2​
C18​
C20​
C12​
C5​
C6​
2
20%​
16%​
20%​
5%​
4%​
12%​

<tbody>
</tbody>


Sheet2

A
B
C
D
E
F
G
H
I
J
1
C2​
C12​
C6​
C3​
C9​
C18​
C5​
C20​
Result​
2
100​
234​
25​
17​
27​
15​
30​
50​
48,3​

<tbody>
</tbody>


Formula in J2
=SUMPRODUCT(SUMIF(Sheet1!A1:F1,A1:H1,Sheet1!A2:F2)*A2:H2)

Hope this helps

M.

Hi Marcelo
Thanks a lot. In fact, your formula did not work for me. I wonder if the problem is that I have some cells blank? My data actually looks more like this:

ABCDEF
1C2C18C20
220%16%20%

<tbody>
</tbody>

ABCDEFGHI
1
C2C18C20C17
2
31406651509572

<tbody>
</tbody>

I would like the formula to do the sum multiplication with the values in the second table in row 3. However, I would like a formula that selects the full table (i.e. including the columns with blank cells - for example, columns E to I in the second table).

Many thanks for your help
 
Upvote 0
OK, I found the mistake! There were some values equal to "blank" and this gave an error. I have sorted it out by giving value 0 to blank cells.

Thanks!
Jordi
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,199
Members
449,072
Latest member
DW Draft

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