How to Fix Excel Formulas That Fail When the Source Workbook is Closed
Question details
Users need a workaround for Excel formulas that break or return errors when referencing external data in a closed source workbook.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Aggregating or analyzing data across multiple workbooks where keeping all source files open simultaneously is not feasible.
- Observed behavior
- Certain functions, particularly SUMIFS, COUNTIFS, and INDIRECT, return a #VALUE! or #REF! error instead of the calculated result when the referenced external workbook is closed.
Before modifying your formulas, locate the exact file path, file name, and worksheet names of your external source data, as any typos in the file path will cause the new references to fail.
Use Power Query to Import and Calculate Data
Power Query securely connects to external workbooks without needing them open, avoiding the inherent limitations of closed-workbook formulas.
Functions like SUMIFS and COUNTIFS inherently fail when linked to closed workbooks because they cannot pull dynamic arrays from inactive files. Power Query provides a robust, native solution by directly extracting and processing the external data in the background.
Open your destination Excel workbook and navigate to the 'Data' tab on the ribbon.
Click on 'Get Data' (or 'New Query'), select 'From File', and then choose 'From Workbook'.
Browse to the location of your closed source workbook, select the file, and click 'Import'.
In the Navigator window, select the specific sheet containing your source data and click 'Transform Data' to filter it. Once ready, click 'Close & Load' to output the data into your current workbook where you can safely run SUMIFS.

Replace SUMIFS with the SUMPRODUCT Function
If you prefer using purely formula-based solutions, SUMPRODUCT can process arrays from closed workbooks where SUMIFS fails.
Experience Seamless Data Management with WPS Office
Tired of dealing with complex Excel errors and broken external links? WPS Office offers a lightweight, free, and fully compatible alternative to Microsoft Office. Enjoy a familiar interface and comprehensive spreadsheet features without the heavy subscription costs.
- 1. Download and Install: Get WPS Office for free from the official website and install it on your computer.
- 2. Open Your Excel File: Launch WPS Spreadsheet and open your existing .xlsx workbooks directly without losing any formatting or data.
- 3. Manage Your Data: Use WPS Spreadsheet's intuitive formula tools to link, calculate, and analyze your data seamlessly.

Frequently Asked Questions
Why does the SUMIFS function return a #VALUE! error when the source file is closed?
Functions like SUMIFS, COUNTIFS, and AVERAGEIFS are designed to evaluate ranges dynamically. When the external workbook is closed, the spreadsheet application cannot retrieve the necessary array elements in real-time, resulting in a #VALUE! error.
Does the INDIRECT function work with closed workbooks?
No, the INDIRECT function will always return a #REF! error if the workbook it references is closed. You must either keep the source file open or use data import tools like Power Query.
Can I link to a closed workbook using a basic cell reference?
Yes, standard cell references (e.g., ='C:\[Source.xlsx]Sheet1'!A1) will work perfectly even when the source workbook is closed. The closed-workbook limitation primarily affects complex array formulas and specific conditional functions.
How do I manually update links to an external workbook?
Navigate to the 'Data' tab, click on 'Edit Links' (or 'Queries & Connections'), select your linked source file from the list, and click 'Update Values' to manually refresh the data pulled from the closed workbook.




