Sumif/Sumproduct with a column match?

tightwad

Well-known Member
Joined
Feb 22, 2006
Messages
609
I have 4 sheets of data I am combining into one report. Down the left side there are columns for Region, District, and Market, and across the top are week numbers.

I want to sum the data where Region = value in B1, and week# = the value in C1

If I knew the column I needed all the time it would be easy to use a Sumif, or multiple matches use Sumproduct...but the column needed changes depending on the week #
 

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
You can get the range for the SUMIF with INDEX, e.g. with week numbers in B1:J1 and Regions in A2:A10

=SUMIF(Data!A2:A10,B1,INDEX(Data!B2:J10,0,MATCH(C1,Data!B1:J1,0)))
 

tightwad

Well-known Member
Joined
Feb 22, 2006
Messages
609
Worked like a charm! I knew there would be a way, I just couldnt envision it.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,721
Messages
5,597,752
Members
414,171
Latest member
12Rev79

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
Top