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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,162
Messages
6,170,432
Members
452,326
Latest member
johnshaji

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