Formula Errors

Fix SUMPRODUCT and INDIRECT #REF! Error Across Multiple Sheets in Excel

Ayan MasoodAyan Masood Nov 10, 2026 869 views

Question details

The user needs to resolve a #REF! error occurring in a SUMPRODUCT formula that uses COUNTIF and INDIRECT to reference a list of worksheet names stored in a cell range.

How to Fix SUMPRODUCT and INDIRECT #REF! Error Across Multiple Sheets
Product
Spreadsheets
Device & OS
not provided
Scenario
Calculating data dynamically across multiple worksheets by maintaining a list of sheet names in a specific cell range.
Observed behavior
The formula returns a #REF! error because the INDIRECT function fails to process one or more worksheet names, either due to an invalid name in the list or disabled macro settings.
Before you start

Verify that your referenced range does not contain any blank cells or hidden characters, as passing an empty string to the INDIRECT function will immediately trigger a #REF! error.

Solution 1Recommended

Verify and Correct Worksheet Names in the Reference Range

Ensure every cell in your referenced list contains an exact, valid worksheet name to prevent the INDIRECT function from failing.

1
Select your referenced range

Highlight the specific range in your worksheet (e.g., H5:H145) that contains the list of sheet names your INDIRECT formula is calling.

2
Check for exact matches

Compare each text string in the cells exactly with the names on the worksheet tabs. Ensure there are no typos, extra spaces, or missing punctuation marks.

3
Format sheet names with spaces

If your worksheet names contain spaces (e.g., 'Sales Data'), verify that your INDIRECT formula string encloses the sheet name in single quotes, such as: "'"&H5&"'!A1:A10".

4
Recalculate the formula

Once corrections are made, press F9 or navigate to the Formulas tab and click 'Calculate Now' to refresh the SUMPRODUCT formula.

Verify and Correct Worksheet Names in the Reference Range

Effortlessly Manage Complex Formulas in WPS Spreadsheet

WPS Office provides a highly compatible and powerful Spreadsheet tool designed to help you easily handle advanced array formulas like SUMPRODUCT and INDIRECT. It efficiently processes 3D referencing across multiple sheets with built-in error checking to help you resolve issues like #REF! instantly.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your multiple worksheets.
  2. 2. Input your formula: Select the target cell and enter your `=SUMPRODUCT(COUNTIF(INDIRECT(...)))` formula exactly as you would normally.
  3. 3. Use Error Checking: If a #REF! error appears, go to the Formulas tab and click 'Error Checking' to instantly trace the exact cell causing the invalid reference.
  4. 4. Evaluate the formula: Click 'Evaluate Formula' in the same tab to watch the formula calculate step-by-step, making it easy to spot exactly which sheet name is failing.
Fully compatible with all Microsoft Excel formulas, including SUMPRODUCT and INDIRECT.Built-in error checking tools to instantly trace and resolve #REF! errors.Lightweight, fast, and completely free to use for daily office tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the INDIRECT function return a #REF! error?

The INDIRECT function returns a #REF! error if the referenced cell evaluates to an invalid cell reference, a misspelled worksheet name, a closed external workbook, or a blank cell.

How do I handle worksheet names with spaces in an INDIRECT formula?

If your worksheet name contains spaces, you must enclose the sheet name in single quotation marks within the formula text string. For example, your formula should look like: `=INDIRECT("'"&A1&"'!B2")`.

Are there better alternatives to using SUMPRODUCT and INDIRECT across multiple sheets?

Yes. If your spreadsheet software supports dynamic arrays, you can use 3D references combined with functions like VSTACK and FILTER. These modern functions are less volatile, faster to calculate, and less prone to #REF! errors compared to INDIRECT.