vlookup with dynamic file path

wilfrid147

New Member
Joined
Jul 17, 2015
Messages
14
Hi there,

I am looking to perform a vlookup using an array from a closed file. However, since this formula will have to be used on a quarterly basis, I am looking to incorporate a dynamic element into the file path. Below is an example.

VLOOKUP($A2,'P:\invest\Attribution - FACTSET\Jun16\Quarter\[SFGLOBALGROWTHCOMP.xls]Sector'!$B$12:$V$3479,19,FALSE)

Since I will be doing this in 3 months again, ideally I would like to update the "Jun16" to "Sep16" which will match another file. Currently I am using

TEXT(NOW()-31,"mmm")&TEXT(NOW()-31,"yy")

to get a dynamic month and year name. However, I'm having trouble incorporating this into the file path using & without excel coming up with an error.

Your help is very much appreciated.


W
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
=VLOOKUP($A2, INDIRECT("'P:\invest\Attribution - FACTSET\" & TEXT(NOW()-31,"mmm") & TEXT(NOW()-31,"yy") & "\Quarter\[SFGLOBALGROWTHCOMP.xls]Sector'!$B$12:$V$3479"),19,FALSE)

I think! Untested ...

WBD
 
Upvote 0
I just read an article on how you can't use INDIRECT with external workbooks. Seems that this approach won't work anyway. Sorry. You're into UDF territory.

WBD
 
Upvote 0

Forum statistics

Threads
1,215,740
Messages
6,126,582
Members
449,319
Latest member
iaincmac

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