Path Variable in Formula

JLouis

Active Member
Joined
Jan 1, 2004
Messages
295
Office Version
  1. 365
Platform
  1. Windows
I have a VLOOKUP formula in a worksheet as follows:
"=VLOOKUP("Total Disc / Coup",'M:\Dropbox\1 Administration\NEW MONTHLY EXTENSIONS 2022\MONTHLY GL\7\[276.dsr.xls]Sheet1'!$A$1:$P$22,9,FALSE)"
I've created a named cell reference on another sheet names "periodx" where the number 7 is located but the number changes based on the month. I'm looking for help writing the formula to use the correct numbered reference depending on the month such as:
"=VLOOKUP("Total Disc / Coup",'M:\Dropbox\1 Administration\NEW MONTHLY EXTENSIONS 2022\MONTHLY GL\"& periodx &"\[276.dsr.xls]Sheet1'!$A$1:$P$22,9,FALSE)"

Thank you in advance.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Will the other workbook be open?
 
Upvote 0
Yes it is. It opens when the main worksheet opens and then closes during the opening sequence. I could leave it open if needed.
 
Upvote 0
Ok, you can use
Excel Formula:
=VLOOKUP("Total Disc / Coup",INDIRECT("'M:\Dropbox\1 Administration\NEW MONTHLY EXTENSIONS 2022\MONTHLY GL\"& periodx &"\[276.dsr.xls]Sheet1'!$A$1:$P$22"),9,FALSE)
although it will fail if the other workbook is closed.
 
Upvote 0
Thank you for the reply. When I copy and paste this formula with the other workbook opened I get a #REF error.
 
Upvote 0
Did you copy the formula using the copy icon in the top right of the tag?
 
Upvote 0
I did.
=VLOOKUP("Total Disc / Coup",INDIRECT("'M:\Dropbox\1 Administration\NEW MONTHLY EXTENSIONS 2022\MONTHLY GL\"& periodx &"\[276.dsr.xls]Sheet1'!$A$1:$P$22"),9,FALSE)
 
Upvote 0
Is the file stored on Dropbox?
 
Upvote 0
Yes, both files are in a Dropbox folder although they are stored locally. I moved the files over to my desktop but it didn't solve the issue.
 
Upvote 0
In that case check the the cell with 7 does not have anything else in it.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,716
Members
448,985
Latest member
chocbudda

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