Sum if lookup value matches

jayjay226

New Member
Joined
Aug 13, 2015
Messages
14
Hi everyone

Hoping someone can help...

I have 2 tables on different sheets like so:

Sheet 1
ABCDEFG
1JanFebMarAprMayJun
2Apples
10% Off25% Off20% Off20% Off10% Off20% Off
3Oranges20% Off25% Off10% Off20% Off10% Off20% Off
4Bananas25% Off20% Off10% Off25% Off10% Off25% Off

<tbody>
</tbody>

Sheet 2
ABCDEFGHIJ
1JanFebMarAprMayJun10% Off20% Off25% Off
2Apples203542101213
3Oranges15351095612
4Bananas56718412

<tbody>
</tbody>

In cells H2:J4, I want to sum the values in B:G if the lookup value for that month in table 1 matches the heading in H1:J1

Sheet 2 is a lot longer than Sheet 1 with the names appearing multiple times so I don't think I can just do a basic SUMIF

Thanks in advance for you help
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Values for H2:J2 (Apples) should be 32, 65 and 35 respectively
Values for H3:J3 (Oranges) should be 66, 36 and 35 resepctively

What I'm trying to do is find out from table 1 which months we ran the promotion in the heading (e.g. "10% off) for that product, then sum up the values for the matching months.

So the Apples line for example, under "10% off" it would add up the values for Jan and May, 20% would add up Mar, Apr, and June, and so on

Thanks again
 
Upvote 0
Each product appears only once in Sheet 1 (sort of like a master list) but will appear multiple times in the sales data in Sheet 2 with different values

Thanks
 
Upvote 0
In H2 of Sheet2 control+shift+enter, not just enter, copy across, and down:

=SUM(IF(Sheet1!$A$2:$A$4=$A2,IF(Sheet1!$B$2:$G$4=H$1,$B2:$G2)))
 
Upvote 0
An afterthought, using SUMIFS...

In H2 of Sheet2 just enter, copy across, and down:

=SUMIFS($B2:$G2,INDEX(Sheet1!$B$2:$G$4,MATCH($A2,Sheet1!$A$2:$A$4,0),0),H$1)

which would be a tad faster.
 
Upvote 0

Forum statistics

Threads
1,216,109
Messages
6,128,883
Members
449,477
Latest member
panjongshing

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