Referencing a workbook with a variable file name

Pawlz

New Member
Joined
Jan 12, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hi All,

I hope you are well!

Does anyone know of a way of referencing a workbook with a variable file name in a formula? The formula is quite simple, just a SUM formula that references a cell on a sheet in a different workbook. The formula is :

=SUM('J:\Production\Pawlz\Daily\[SHIFT REPORT WC 01.01.24.xlsx]Monday '!$D$78:$D$83)

Basically, just adding the total of cells D78 through to D83 and there are 56 formulas of this type on the worksheet. A new SHIFT REPORT file is created each week and stored in the same location (so we end up with 52 files, 1 for each week, at the end of the year). Currently, I overwrite SHIFT REPORT WC 01.01.2024.xlsx each week with the current week's workbook. I am looking for a way to automatically change the formula to the current week commencing file.

I have already got a series of formulas that generate the file name from the current date - [SHIFT REPORT WC 01.01.2024.xlsx]. I was hoping to somehow integrate this into a formula so it changes automatically based on the current date.

Or is there an easier solution?

Cheers

Pawlz
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You can use INDIRECT but it will only work if the source file is open. I'd just use the edit links dialog to change the source workbook.
 
Upvote 0

Forum statistics

Threads
1,223,719
Messages
6,174,089
Members
452,542
Latest member
Bricklin

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