How to Fix SPILL or NAME Errors in Excel INDEX MATCH Formulas
Question details
The user needs to correct syntax and referencing issues in an INDEX MATCH formula that returns #SPILL! or #NAME? errors when copied across the worksheet.
- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Setting up a cross-sheet dynamic lookup formula using INDEX MATCH that will be dragged across multiple columns starting from a specific cell.
- Observed behavior
- The formula fails and returns SPILL or NAME errors because lookup ranges are not absolute, references shift, or formula results are wrapped in incorrect quotation marks.
Verify that your destination cells are completely empty without any hidden text or merged cells, as blockages in the target area will immediately trigger a #SPILL! error.
Correct the Formula Syntax and Lock Cell References
Fix the formula structure by removing improper quotation marks, applying absolute references to your lookup ranges, and wrapping the calculation in IFERROR.
When dragging an INDEX MATCH formula across multiple columns or rows, relative references shift automatically. If the source ranges shift outside the actual dataset, it triggers #SPILL! or #NAME? errors. Furthermore, wrapping array results or functional references in unnecessary quotation marks turns them into static text, breaking the formula's calculation.
Inspect your INDEX MATCH formula in the formula bar. Delete any quotation marks that were placed around cell references or the overall formula result. Quotation marks should only encapsulate literal text strings or specific sheet names containing spaces.
Highlight the cell ranges for your INDEX data array and your MATCH lookup arrays. Press the F4 key on your keyboard to insert dollar signs (e.g., changing V7:AG18 to $V$7:$AG$18). This locks the lookup bounds so they remain fixed when the formula is copied.
To prevent unsightly error codes when a match is not found or divided by an empty cell, wrap the entire syntax in an IFERROR function. For example: =IFERROR(INDEX('Direct RRP1'!$V$7:$AG$18,MATCH($M6,'Direct RRP1'!$U$7:$U$18,0),MATCH(AF$5,'Direct RRP1'!$V$6:$AF$6,0))/'Direct FG List'!$U6, 0).
Click on the cell containing the corrected formula (e.g., AF6). Click and hold the fill handle (the small square at the bottom-right corner of the cell), then drag it across the target columns to calculate the remaining cells without generating SPILL errors.
Build Error-Free INDEX MATCH Formulas in WPS Spreadsheet
WPS Spreadsheet provides robust formula auditing features and exact compatibility with advanced array functions like INDEX and MATCH. Its intuitive interface helps you quickly spot missing absolute references and syntax errors.
- 1. Open the Spreadsheet in WPS Office: Launch WPS Office and open your workbook containing the data sheets and the target INDEX MATCH cells.
- 2. Draft the INDEX MATCH Formula: Select your starting cell and type out the INDEX MATCH formula. When selecting your data ranges, simply press F4 to automatically lock them with absolute references.
- 3. Use Formula Auditing to Check for Errors: Navigate to the Formulas tab on the ribbon and click 'Evaluate Formula'. This tool lets you step into the calculation to verify that your array sizes match and no SPILL conflicts occur.
- 4. Apply and Fill: Press Enter to finalize the formula, then double-click or drag the fill handle at the bottom-right of the cell to populate your data across the worksheet instantly.

Frequently Asked Questions
Why does my INDEX MATCH formula return a #SPILL! error?
A #SPILL! error occurs when an array formula attempts to return multiple values across adjacent cells, but those target cells are not empty. Hidden spaces, existing text, or merged cells in the spill range will block the calculation.
What causes a #NAME? error in Excel formulas?
The #NAME? error usually indicates a typo in the formula syntax. This happens if you misspell a function (e.g., INDX instead of INDEX), reference a Named Range that has been deleted or misspelled, or forget to enclose text criteria in quotation marks.
How do I lock cell references before dragging a formula?
To lock a cell reference, select it in the formula bar and press the F4 key. This adds dollar signs before the column letter and row number (e.g., $A$1), turning it into an absolute reference that will not change when copied.
Is it required to use IFERROR with INDEX MATCH?
While not strictly required, it is a highly recommended best practice. If MATCH cannot find the lookup value, it returns an #N/A error. Wrapping the formula in IFERROR allows you to output a clean 0 or blank cell instead.




