Dynamic range in match and index

Skiff

Board Regular
Joined
May 30, 2016
Messages
58
Office Version
  1. 2019
Platform
  1. Windows
Hi.
I've got very distinct problem with formulas. I need to dynamically detect column for vlookup or index/match combination to get relevant history data

I create manually sheet composed of history data (just a part of data, but structure is visible):
2022-012022-022022-032022-042022-052022-062022-07
name1
0​
name1
0,045​
name1
0​
name1
0​
name1
0,063​
name1
0,12​
name1
0​
name2
0,077​
name2
0,048​
name4
0​
name4
0​
name4
0​
name4
0​
name4
0​
name3
0,091​
name3
0,045​
name2
0​
name2
0,125​
name2
0,074​
name2
0,034​
name2
0,07​
This is basically two columns copied from pivot table of each months report.

And then into new month I've connect this data for each name. So when I have report for 2022-10 then I get 3 history columns data from above (see last 3 columns)

denominatornumerator%pp2022-072022-082022-09
Sum
916​
21​
2,3%
-11,6pp​
4,0%3,6%13,9%
name1
1​
0​
0,0%
name2
15​
0​
0,0%
-14,3pp​
0,0%0,0%14,3%
name3
46​
0​
0,0%
-2,0pp​
0,0%0,0%2,0%
name4
31​
0​
0,0%
-17,1pp​
7,0%2,6%17,1%

So I've managed to work it out with INDIRECT since offset results in #NA error

Excel Formula:
=VLOOKUP($A5,INDIRECT(CONCAT("'[hist.xlsx]hist'!C",MATCH(TEXT(F$3,"yyyy-mm"),'[hist.xlsx]hist'!$1:$1,0),":C",MATCH(TEXT(F$3,"yyyy-mm"),'[hist.xlsx]hist'!$1:$1,0)+1),0),2,0)
but historical data is placed in another workbook so it needs to be open for values to appear.
And this is not acceptable because report is distributed by email to end users.

Last resort would be putting archive data into report and hiding those sheets. But first maybe some one has another idea how to get this data (without VBA).

Anyone has any workaround to it?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,214,793
Messages
6,121,614
Members
449,039
Latest member
Mbone Mathonsi

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