INDEX MATCH with Multiple Criteria and Multiple Sheets

Lalalauren191

New Member
Joined
Mar 25, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
So maybe I need to use a different formula entirely, but here is my data first and then my question.

  • Location is cell B2
  • Month is cell B3
  • Sheets that the data is being pulled from are:
    • GSP D18
    • GSP D35
    • GSP D110
    • GSP D121
  • Index range on each sheet is B5:BQ17
  • Match Range on each sheet for location names is A5:A17
  • Match Range on each sheet for month is B3:BQ3
  • My full current formula is: =INDEX('GSP D18'!$B$5:$BQ$17,MATCH($B$2,'GSP D18'!$A$5:$A$17,0),MATCH($B$3,'GSP D18'!$B$3:$BQ$3,0))
My issue is that this formula works to pull data from GSP D18, but I cannot figure out a way to get it to look at multiple sheets. Ultimately I need a formula that will look for a location number on each sheet and return data based on both the month and location since it is a trend file. It is not possible to add all the information to 1 sheet, since each sheet contains so much additional information that is not in the range provided.

Hopefully this was enough information.
 
Perhaps something along these lines? Workbook here: Example.xls

Match across dynamic ranges, multiple sheets.xlsx
ABCDEFGH
1User Input:LocationSheet nameSheetListCount
2MyLocation502426GSP D18GSP D189
3MyTrendTrend2502GSP D35GSP D357
4MyMonth1/02/2020504GSP D18
5505GSP D18
6Helper cell668GSP D35
7MySheet'GSP D35'!776GSP D35
81466GSP D35
9Result261515GSP D18
101GSP D18
112GSP D18
123GSP D18
134GSP D18
145GSP D18
1511GSP D35
1612GSP D35
1713GSP D35
MASTER
Cell Formulas
RangeFormula
H2:H3H2=COUNTIF(INDEX(LocationTable,,2),G2)
B7B7="'"&VLOOKUP(B2,LocationTable,2,)&"'!"
B9B9=VLOOKUP(MyLocation,INDEX(INDIRECT(MySheet&"$A:$A"),MATCH(MyTrend,INDIRECT(MySheet&"$A:$A"),)+1):INDEX(INDIRECT(MySheet&"$F:$F"),MATCH(MyTrend,INDIRECT(MySheet&"$A:$A"),)+VLOOKUP(VLOOKUP(B2,LocationTable,2,),SheetList,2)),1+MATCH(MyMonth,MyDates,),)
E2:E17E2=INDEX(SheetList,MATCH(1,COUNTIF(INDIRECT("'"&INDEX(SheetList,,1)&"'!A$5:A$17"),D2)^0,),1)
Named Ranges
NameRefers ToCells
LocationTable=MASTER!$D$2:$E$17B9, E2, B7, H2:H3
MyLocation=MASTER!$B$2B9, B7
MyMonth=MASTER!$B$4B9
MySheet=MASTER!$B$7B9
MyTrend=MASTER!$B$3B9
SheetList=MASTER!$G$2:$H$3B9, E2:E17, H2


Match across dynamic ranges, multiple sheets.xlsx
ABCDEF
3SiteJan 2020Feb 2020Mar 2020Apr 2020May 2020
4Trend1
55056015791838
64263475986311
71515601301333
85041181001511
916042379892
1026724716337
113849785063
1244368657855
1359819687423
14
15Trend2
165057977887330
17426803279467
181515455726216
19504626278528
2019281557144
2125076333799
2233371264070
2342179908375
245569634784
GSP D18


Match across dynamic ranges, multiple sheets.xlsx
ABCDEF
3SiteJan 2020Feb 2020Mar 2020Apr 2020May 2020
4Trend1
5776902876215
6668281553822
71466155165232
8502135819855
9115248272657
10125158253185
11135374631064
12
13Trend2
147766799217484
15668158717950
1614664264993381
1750287266213100
18114619699757
19121868714717
2013152932926
GSP D35
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Perhaps something along these lines? Workbook here: Example.xls

Match across dynamic ranges, multiple sheets.xlsx
ABCDEFGH
1User Input:LocationSheet nameSheetListCount
2MyLocation502426GSP D18GSP D189
3MyTrendTrend2502GSP D35GSP D357
4MyMonth1/02/2020504GSP D18
5505GSP D18
6Helper cell668GSP D35
7MySheet'GSP D35'!776GSP D35
81466GSP D35
9Result261515GSP D18
101GSP D18
112GSP D18
123GSP D18
134GSP D18
145GSP D18
1511GSP D35
1612GSP D35
1713GSP D35
MASTER
Cell Formulas
RangeFormula
H2:H3H2=COUNTIF(INDEX(LocationTable,,2),G2)
B7B7="'"&VLOOKUP(B2,LocationTable,2,)&"'!"
B9B9=VLOOKUP(MyLocation,INDEX(INDIRECT(MySheet&"$A:$A"),MATCH(MyTrend,INDIRECT(MySheet&"$A:$A"),)+1):INDEX(INDIRECT(MySheet&"$F:$F"),MATCH(MyTrend,INDIRECT(MySheet&"$A:$A"),)+VLOOKUP(VLOOKUP(B2,LocationTable,2,),SheetList,2)),1+MATCH(MyMonth,MyDates,),)
E2:E17E2=INDEX(SheetList,MATCH(1,COUNTIF(INDIRECT("'"&INDEX(SheetList,,1)&"'!A$5:A$17"),D2)^0,),1)
Named Ranges
NameRefers ToCells
LocationTable=MASTER!$D$2:$E$17B9, E2, B7, H2:H3
MyLocation=MASTER!$B$2B9, B7
MyMonth=MASTER!$B$4B9
MySheet=MASTER!$B$7B9
MyTrend=MASTER!$B$3B9
SheetList=MASTER!$G$2:$H$3B9, E2:E17, H2


Match across dynamic ranges, multiple sheets.xlsx
ABCDEF
3SiteJan 2020Feb 2020Mar 2020Apr 2020May 2020
4Trend1
55056015791838
64263475986311
71515601301333
85041181001511
916042379892
1026724716337
113849785063
1244368657855
1359819687423
14
15Trend2
165057977887330
17426803279467
181515455726216
19504626278528
2019281557144
2125076333799
2233371264070
2342179908375
245569634784
GSP D18


Match across dynamic ranges, multiple sheets.xlsx
ABCDEF
3SiteJan 2020Feb 2020Mar 2020Apr 2020May 2020
4Trend1
5776902876215
6668281553822
71466155165232
8502135819855
9115248272657
10125158253185
11135374631064
12
13Trend2
147766799217484
15668158717950
1614664264993381
1750287266213100
18114619699757
19121868714717
2013152932926
GSP D35


You are a genius. Thank you!
 
Upvote 0

Forum statistics

Threads
1,215,446
Messages
6,124,900
Members
449,194
Latest member
JayEggleton

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