Cross-file changing refrence

GexcelG

New Member
Joined
May 15, 2018
Messages
7
Hi,
I have a weekly file. just for the eaxmple file names are: 4-Oct.xlsx, 11-Oct.xlsx, 18-Oct.xlsx.
now i am working in the file named 25-Oct.xlsx and i want to have a formula that can take values from the 3 above ( 4-Oct.xlsx, 11-Oct.xlsx, 18-Oct.xls)
i want to use a formula so next week when i'll have file 1-Nov, he will refrence to the previous 3 weeks' files: ( 11-Oct.xlsx, 18-Oct.xlsx, 25-Oct.xlsx).

east part is getting te file name of current file (=cell(filename)) which will return C:\Folder\[25-Oct.xlsx]sheetname

how can i edit this value to have -7 days in the name e.g.: C:\Folder\[18-Oct.xlsx]sheetname, and how can use this text value to creare a refrence to a specific cell within this file:
C:\Folder\[18-Oct.xlsx]sheetname'!$K$12.

thanks !!!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
file name of current file (=cell(filename)) which will return C:\Folder\[25-Oct.xlsx]sheetname
OK, let say that the cell with that formula is cell A1. To return a file name for 7 days prior ("18-Oct.xlsx"), you can use this formula:
Code:
=TEXT(DATEVALUE(TRIM(MID(SUBSTITUTE(SUBSTITUTE(A1,"[",REPT(" ",100)),".xlsx]",REPT(" ",100)),100,20)))-7,"d-mmm") & ".xlsx"
 
Upvote 0

Forum statistics

Threads
1,215,842
Messages
6,127,231
Members
449,371
Latest member
strawberrish

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