Vlookup with dynamic summing????

Mark McInerney

Active Member
Joined
Apr 4, 2012
Messages
288
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have data in B1:BC102

In Column B there are department tags. From Column C thru BC there are department sales for each week number.

I want to be able to select a department from a drop down and also select two week numbers and then to return the sum of the sales for that department between those two weeks.

e.g. Grocery Sales Total from Week 2 thru to and including Week 7.

Any help appreciated.

I have been using the following in another worksheet, but as you can see the reference to the department that I am summing is fixed and not dynamic.

=SUM(INDEX('2018 Data'!D7:BC7,MATCH(K154,'2018 Data'!D5:BC5)):INDEX('2018 Data'!D7:BC7,MATCH(M154,'2018 Data'!D5:BC5)))

How do i make the reference to D7:BC7 above dynamic linked to my drop down?

Thanks.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Consider using a SUMIFS function

=SUMIFS(INDEX(C1:BC102,MATCH(Department, B1:B102,0),0), C1:BC1, ">=" & Start_Week, C1:BC1, "<=" & End _Week)
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,195
Members
453,021
Latest member
pingpong7117

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