Fix Excel #VALUE! Errors When a Source Workbook Is Closed
Question details
The user needs an Excel formula to retrieve or calculate values from a source workbook after it is closed.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A formula references a separate, read-only workbook that may not remain open.
- Observed behavior
- The formula returns the expected values while the source workbook is open but shows #VALUE! after it is closed.
Open both workbooks and check the formula for INDIRECT or a criteria function such as COUNTIF. Confirm that the source file path is valid and that you have permission to read the workbook; read-only status alone does not explain the error.
Replace INDIRECT with a direct external reference
Use a direct link when the formula needs a known cell or range from the source workbook.
INDIRECT cannot resolve a reference to a closed external workbook. A direct external reference can retrieve saved values without keeping the source open.
Open both workbooks, select the destination cell, and inspect its formula in the formula bar for INDIRECT.
Replace the INDIRECT expression by typing =, selecting the source workbook and the required cell, and pressing Enter. Excel creates an external reference such as ='[Source.xlsx]Sheet1'!$B$2.
Save and close the source workbook, then recalculate the destination workbook. Excel may expand the reference to include the source file path.
If the result is still wrong, open Data > Workbook Links or Data > Edit Links, depending on your Excel version, and check or change the source path.
Revise criteria calculations for a closed workbook
Use this approach when a COUNTIF-style formula returns #VALUE! after the source workbook closes.
Import the source data with Power Query
Use Power Query when you need a refreshable local copy of data from the source workbook.
Work with Linked Spreadsheets in WPS Office
WPS Office is a free, lightweight, easy-to-use alternative with a familiar spreadsheet interface and support for common Excel formats, making it easier to move existing files. It does not repair an Excel-specific formula error.

Frequently Asked Questions
Why does INDIRECT return #VALUE! when the source workbook closes?
Excel's INDIRECT function cannot resolve a reference to a closed external workbook. Replace it with a direct external reference where the target cell or range is known.
Does read-only access cause the formula error?
Read-only access alone is not necessarily the cause. Check whether the formula uses INDIRECT or a criteria function that cannot reliably read a closed external range, and confirm that the source path is accessible.
What can I use instead of COUNTIF with a closed workbook?
For a simple count, try SUMPRODUCT with a direct, bounded external range. Alternatively, calculate the count in the source workbook, save it, and link directly to the result cell.
How do I update data imported with Power Query?
In the destination workbook, choose Data > Refresh All. The source file must be available at the location used by the query.
Where can I check a broken external workbook link?
Open Data > Workbook Links or Data > Edit Links, depending on your Excel version, and review the source location. Update the source if the file has moved.




