vlookup where a cell selects which sheet data is pulled from

muhleebbin

Board Regular
Joined
Sep 30, 2017
Messages
181
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2010
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
Hi,

A traditional vlookup would look like the following:

VLOOKUP(Report!$D23,'Test 1'!$A$3:$AZ$300,Report!F$19,FALSE

Is there a way where the sheet 'Test 1' could be governed by a cell on another sheet "Variable" cell E1? I found code that could vlookup across multiple sheets however one requirement was the same order of columns, because this is for an accounting project, the number of columns will increase as the year passes and I wasn't sure if that would still fit the requirement.

Thanks in advance for your help!
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

muhleebbin

Board Regular
Joined
Sep 30, 2017
Messages
181
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2010
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
Found the answer.....

VLOOKUP($D23,INDIRECT("'"&Variables!$E$1&"'!"&"$A$3:$AZ$300"),Report!F$19,FALSE
 

Forum statistics

Threads
1,148,159
Messages
5,745,111
Members
423,924
Latest member
Gazzat

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
Top