Vlookup another workbook and sheet using dynamic references

AlanZA

New Member
Joined
May 22, 2019
Messages
7
Hi,

I am trying to vlookup another workbook and sheet using cells as a reference. My equation is below and I can't seem to get it to work. It keeps giving a #REF ! error.

=VLOOKUP($A2,INDIRECT("'["&K1&"]"&J1&"'!"&"$A:$BE"),8,FALSE)

Please assist. Many thanks.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
This is the part that's at fault

INDIRECT("'["&K1&"]"&J1&"'!"&"$A:$BE")

Place the formula in a blank cell, removing the INDIRECT and see what the result is, it should be a range

You can shorten it to this to make it more readable

INDIRECT("'["&K1&"]"&J1&"'!$A:$BE")
 
Upvote 0
The formula looks fine to me. The reference error will come from whatever is in K1 and J1 not referencing a valid open workbook name and sheet name from that workbook.
 
Upvote 0
When put in a blank cell I get the following:
'[Combined Tax Salary Sheet 2020.xlsm]SalMay19'!$A:$BE

Why won't it find the range on that sheet?
 
Upvote 0
Does this error?

='[Combined Tax Salary Sheet 2020.xlsm]SalMay19'!A1
 
Upvote 0
And by opening the reference workbook it now works. Does the reference workbook always need to be open for it to work?
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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