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 #
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
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)))
 
Upvote 0

Forum statistics

Threads
1,214,598
Messages
6,120,441
Members
448,966
Latest member
DannyC96

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