Dynamic Index & Match - can it be done

Paul at GTS

Board Regular
Joined
May 17, 2004
Messages
56
Office Version
  1. 365
Platform
  1. Windows
Hi,
We have two workbooks, one logs delivery statistics, the other logs sales statistics.

At present we have the sales workbook looking at the delivery workbook to pull out milages etc. The workbooks have a tab per month.

The data is pulled across using Index & Match with named ranges.

My issue is that the named range needs to be changed with the start of each new month as the sheet tab changes Jan-19 to Feb-19 etc.

Is there a way of inserting the required tab name into the Named Range - ideally I'd like to input Jan-19 into cell A1 and the month name is picked up from there and positioned in the named range. Below are the formula and ranges from current month.

This is the formula that pulls data over:
=INDEX(MilageMatrix,MATCH($C4,MilageLookup,0),4)

Milage Matrix Range :
='[Time sheets 08 v2.0.xlsx]Jun 19'!$AF$7:$AI$37

Milage Lookup Range :
='[Time sheets 08 v2.0.xlsx]Jun 19'!$AF$7:$AF$37

Can it be done ?

Thanks
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Not a big help, but maybe some guidelines. If you can help the following.

For example, the A1 cell contains the SheetName Tab like "Products". This cell has been named 'SheetName'.
The INDIRECT formula below returns the contents of the cell from the worksheet concerned. The formula returns the data from the cell 'I30' from the WorkSheet Name Tab 'Products'.
Code:
=INDIRECT(ADDRESS(30;9;;;SheetName))
Also, this formula below is similar but has a different meaning.
Code:
=INDIRECT("'"&SheetName&"'!I30")
Also different formula with the same result
Code:
=INDIRECT($A$1&"!$I$30")
btw: You can use INDIRECT.EXT function if you want get data from closed workbook.

You need to find ways to nestled one of the above formulas in your formula.
 
Upvote 0
You're welcome,

btw: I apologize for the first formula. My settings are non-us. As delimiter, instead of semicolons you use a comma.
Code:
=INDIRECT(ADDRESS(30,9,,,SheetName))
 
Upvote 0

Forum statistics

Threads
1,216,117
Messages
6,128,935
Members
449,480
Latest member
yesitisasport

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