Function Problems

Create an Excel Formula for a Workbook File Name Containing a Date

Khadija KhanKhadija Khan Nov 25, 2026 869 views

Question details

Create a reference to a worksheet in another workbook whose file name contains a date stored in cell A1.

Create an Excel Formula for a Workbook File Name Containing a Date
Product
Microsoft Excel
Device & OS
not provided
Scenario
A weekly report has a date in its file name, and the user wants to reference a cell without manually opening 15 to 20 source files.
Observed behavior
The source workbook name changes each week, and Excel's INDIRECT function cannot resolve a reference to a closed workbook.
Before you start

Check whether A1 contains a real Excel date or date text, and confirm the source workbook's extension, sheet name, and target cell. The examples use .xlsx, Sheet1, and E7; adjust them to match your files.

Solution 1Recommended

Build a dynamic reference with INDIRECT for an open workbook

Use this method when you can open the dated source workbook in the same Excel instance.

INDIRECT builds the workbook reference from the date in A1, but Excel requires the referenced workbook to be open. This method does not meet the requirement to keep all source files closed.

1
Open the source workbook

In Excel, open the dated file, such as Report 10-Dec-16.xlsx, alongside the workbook containing the formula.

2
Enter the reference formula

If A1 contains a real Excel date, enter =INDIRECT("'[Report "&TEXT(A1,"dd-mmm-yy")&".xlsx]Sheet1'!E7") in B1. The formatted date must match the file name exactly.

3
Test the returned value

In another cell, enter =IF(ISERROR(B1),"Check reference",IF(ISTEXT(B1),"Y","N")) to return Y for text, N for a non-text value, or a warning if B1 contains an error.

Build a dynamic reference with INDIRECT for an open workbook
If A1 contains text: If A1 already contains the exact file-name text, such as 10-Dec-16, replace TEXT(A1,"dd-mmm-yy") in the INDIRECT formula with A1.
Free Microsoft Office alternative

Work with Excel report files in WPS Spreadsheets

WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Excel format support, making it easy to move existing report files into WPS Spreadsheets. It does not fix Excel's closed-workbook INDIRECT limitation.

Work with dated report spreadsheets in a familiar interfaceOpen and edit Microsoft Excel XLSX filesUse a free, lightweight office suiteMove existing spreadsheet workflows without starting from scratch
microsoft office alternative - wps office

Frequently Asked Questions

Can Excel INDIRECT reference a closed workbook?

No. Excel's INDIRECT function requires the source workbook to be open. For a closed source, use a direct external link or consider an automation approach such as VBA.

Why does my dynamic reference return an error?

Check that the source workbook is open and that the file name, extension, sheet name, and date text match exactly. Enter the INDIRECT formula in a cell by itself to inspect its result.

How do I format the date to match the report file name?

If A1 contains a real Excel date, use TEXT(A1,"dd-mmm-yy") in the formula. If A1 already contains the exact date text used in the file name, use A1 directly.

Can I update a closed-workbook link to the next weekly report?

Yes. Go to Data > Workbook Links or Data > Edit Links, select the linked source, and choose Change source. This is a manual update; it does not automatically use the date in A1.