Reference File Name from Cell Value

Crescendo

New Member
Joined
Aug 6, 2014
Messages
6
Hello All,
I really need your help- i am willing to find out a way in which reference file name for vlookup is from cell O6 from each worksheet.

=IF($C6="","",IFERROR(VLOOKUP($C6,'C:\Users\XYZ\Desktop\[Indirect(!$O$6).xls]DataSheet'!$B$14:$AB$488,9,FALSE),0))

please help me

really appreciate it
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
The entire reference needs to be inside teh INDIRECT(), some thing like ...
=IF($C6="","",IFERROR(VLOOKUP($C6,INDIRECT("'[C:\Users\XYZ\Desktop\"&$O$6&".xls]DataSheet'!$B$14:$AB$488"),9,FALSE),0))
(Hope I got the syntax right, but thats how it is needs to look)
 
Upvote 0
The entire reference needs to be inside teh INDIRECT(), some thing like ...
=IF($C6="","",IFERROR(VLOOKUP($C6,INDIRECT("'[C:\Users\XYZ\Desktop\"&$O$6&".xls]DataSheet'!$B$14:$AB$488"),9,FALSE),0))
(Hope I got the syntax right, but thats how it is needs to look)


Thanks alot ford, one question
I want sheet name to be Variable,
So if i am on A2 putting this formula than it should refer to O6 for same sheet
A3 than its o6 so on and so forth

Can you please suggest if its something doable?
 
Upvote 0
One thing I forgot to mention, is that INDIRECT only works on open workbooks. If your other files will be closed, you will need to try the Morefunc add-in.

For what you want (referencing a wheet name) try this. It kinda looked like you wanted to reference a file name - or part of 1...
=INDIRECT("'[file name.xlsm]"&A8&"'!A11") (This is how it needs to look, in its simplest form)
=IF($C6="","",IFERROR(VLOOKUP($C6,INDIRECT("'[path and file name.xlss]"&A8&"'!$B$14:$AB$488"),9,FALSE),0))
where A8 contains the sheet name and A11 contains the cell you want to reference

You may have noted that I did not bother to absolute the range refs, because they are actually text now
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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