How to Fix INDEX MATCH and SUMPRODUCT #REF! Errors in Excel
Question details
The user needs to fix a #REF! error that occurs when calculating specific categories using a combined SUMPRODUCT and INDEX/MATCH formula.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating categorized data such as Position, Division, Total Hours, and Level of Expertise across multiple worksheets using advanced array and lookup formulas.
- Observed behavior
- The calculation works correctly for one category but throws a #REF! error for other values (like Intermediate or Apprentice) or when pointing to another worksheet.
Before troubleshooting, ensure all worksheets referenced in your formula are currently open and have not been renamed or deleted. Additionally, verify that your lookup criteria do not contain accidental leading or trailing spaces.
Align INDEX and MATCH Range Dimensions
A #REF! error often occurs if the row or column number returned by the MATCH function exceeds the bounds of the array provided in the INDEX function. Matching array dimensions resolves this.
When combining SUMPRODUCT with INDEX and MATCH, all referenced arrays must be perfectly aligned. If INDEX looks at a 100-row range but MATCH is evaluating an entire column, the returned index position may fall outside the target array, triggering a #REF! error.
Select the cell containing the SUMPRODUCT formula that is returning the #REF! error.
Look specifically at the INDEX(array, row_num, [column_num]) segment of the formula.
Check the lookup array inside your MATCH function. Ensure it has the exact same starting and ending rows as the array referenced in the INDEX function (e.g., if INDEX uses A2:A200, MATCH must use B2:B200).
Correct any mismatched ranges so they share the exact same dimensions, then press Enter to recalculate the formula.

Evaluate the Formula to Pinpoint the Error
Step through the complex SUMPRODUCT and INDEX/MATCH calculation to identify exactly which part of the formula is failing.
Easily Troubleshoot Complex Formulas in WPS Spreadsheet
WPS Spreadsheet provides powerful formula auditing tools and full support for advanced functions like SUMPRODUCT, INDEX, and MATCH. It helps you seamlessly build, debug, and manage complex calculations across multiple sheets.
- 1. Open your file: Launch WPS Spreadsheet and open your .xlsx or .csv workbook.
- 2. Locate the error: Click on the cell displaying the #REF! error.
- 3. Audit the formula: Go to the Formulas tab and select 'Evaluate Formula' to step through the SUMPRODUCT and INDEX/MATCH execution.
- 4. Fix the reference: Identify the mismatched range or invalid worksheet reference, adjust the dimensions in the formula bar, and press Enter.

Frequently Asked Questions
Why does my INDEX MATCH formula return #REF! for only certain values?
This usually happens when the MATCH function returns a row or column number that is larger than the range provided to the INDEX function. For example, if INDEX is looking at a 10-row range but MATCH searches an entire column and finds a match at row 15, Excel throws a #REF! error. Ensure your lookup values and array bounds are consistent.
Can SUMPRODUCT cause a #REF! error directly?
SUMPRODUCT itself rarely causes a #REF! error. The error usually originates from nested functions inside it, such as an INDEX/MATCH combination that references a deleted cell, a closed external workbook, or an incorrectly sized array.
How do trailing spaces affect INDEX MATCH calculations?
If your lookup criteria has a trailing space but your source data does not, MATCH will fail to find the value and return an error. Using functions like TRIM() around your lookup values can prevent space-related mismatches.
How do I fix cross-sheet reference #REF! errors?
Check that the worksheet you are referencing hasn't been deleted or renamed. Ensure that the sheet name in the formula is enclosed in single quotes if it contains spaces, and verify that the column or row references point to existing, valid cells.




