sodcalculator

10 Tech How-To

Spill Error in Excel: VLOOKUP, INDEX MATCH, SUMIF Fixes

Guide 10-33052 · Updated · Step by step

The #SPILL! error in Excel appears when a dynamic array formula tries to return multiple results that overlap existing data, or when the spill range is blocked. This article explains what causes #SPILL! errors with VLOOKUP, INDEX MATCH, and SUMIF, and provides step-by-step fixes to resolve them.

What Is the #SPILL! Error?

Excel’s dynamic array engine (introduced in Microsoft 365 and Excel 2021) automatically “spills” results from formulas that return multiple values. For example, =VLOOKUP(A2:A10, D:E, 2, FALSE) returns an array of 9 values, which Excel places in the cells below the formula. If any of those cells already contain data, or if a merged cell or table structure blocks the range, Excel shows #SPILL! instead of the results.

The error message usually includes a note like “Spill range isn’t blank” or “Spill range has a merged cell.” The fix is to clear the obstructing cells, or to force the formula to return a single value using implicit intersection (e.g., @ operator).

Why VLOOKUP Causes #SPILL!

VLOOKUP traditionally expects a single lookup value. When you give it a range (e.g., A2:A10) as the first argument, Excel returns an array of results. This is useful but requires empty space to the right and below the formula cell. If any cell in that space is non-empty, you get #SPILL!.

Common causes:

  • Using a range reference for lookup_value instead of a single cell.
  • Data in the spill area (e.g., a column next to your formula already has values).
  • Merged cells in the spill range.
  • Excel tables (ListObjects) that don’t allow spill ranges to extend beyond the table boundaries.

Example: =VLOOKUP(A2:A5, D:E, 2, FALSE) in cell B2 will spill to B2:B5. If B3 already contains a number, Excel returns #SPILL!.

Why INDEX MATCH Causes #SPILL!

INDEX MATCH is often used as an alternative to VLOOKUP. The #SPILL! error occurs when you use array operations without proper handling. For instance, =INDEX(E:E, MATCH(A2:A10, D:D, 0)) returns an array of 9 values, spilling from the formula cell down. If any cell in that column is occupied, you get #SPILL!.

Another scenario: using MATCH with a range that returns multiple positions, or using INDEX with an array that returns more than one row/column. Also, if you use INDEX without the @ operator in a legacy formula, Excel may spill unexpectedly.

Fix: If you only need one result, use =INDEX(E:E, MATCH(A2, D:D, 0)) (single cell reference). If you need multiple results, ensure the spill range is clear.

Why SUMIF Causes #SPILL!

SUMIF (and SUMIFS) normally returns a single number. However, if you use a range as the sum_range or criteria_range in a way that produces an array, Excel may spill. For example, =SUMIF(A2:A10, {"Apple","Banana"}, B2:B10) returns two numbers (one for each criteria), spilling horizontally. Similarly, using a spilled array as criteria (e.g., SUMIF(A:A, D2#, B:B)) will return an array of results.

Common cause: Using a constant array like {"x","y"} or referencing a spill range (D2#) in the criteria argument.

Fix: If you want a single total, use a single criteria. If you need multiple totals, make sure the cells to the right are empty.

How to Fix #SPILL! Errors

Here are the most effective ways to resolve #SPILL! errors:

  1. Clear the spill range: Click on the formula cell, Excel highlights the intended spill range with a blue border. Delete any data or merged cells in that range.
  2. Use implicit intersection: Add @ before the function name (e.g., =@VLOOKUP(A2:A10, D:E, 2, FALSE)) to force a single result. This is useful when you only want the value from the same row.
  3. Convert to a legacy formula: Press Ctrl+Shift+Enter (CSE) to enter it as an array formula in older Excel versions, but this is not needed in Microsoft 365.
  4. Move the formula: If the spill area is blocked, move the formula to a column with enough empty space.
  5. Use a helper column: For SUMIF with multiple criteria, use a helper column to combine conditions, then use a single SUMIF.
  6. Check for merged cells: Unmerge any merged cells in the spill range.
  7. Remove table boundaries: If your formula is inside an Excel table, the spill range cannot extend beyond the table’s last column. Move the formula outside the table or convert the table to a range.

Preventing #SPILL! Errors

To avoid #SPILL! in the future, follow these best practices:

  • Use single-cell references for VLOOKUP and MATCH lookup values unless you intentionally need multiple results.
  • Before writing a dynamic array formula, ensure the adjacent cells are empty.
  • Use @ to force implicit intersection when you only want one result from a range.
  • For SUMIF with multiple criteria, consider using SUMPRODUCT or a helper column instead of array constants.
  • Keep your data in a proper table structure, but be aware of spill limitations.

Frequently Asked Questions

Why does my VLOOKUP return #SPILL! when I only want one value?

Because you are using a range as the lookup_value (e.g., A2:A10) instead of a single cell. Change it to A2 or use @VLOOKUP(...) to get the value from the same row.

Can I use INDEX MATCH to return multiple values without #SPILL!?

Yes, if you have Excel 365, you can use the FILTER function instead. Or, if you want multiple matches, use =INDEX(E:E, SMALL(IF(D:D=A2, ROW(D:D)), ROW(1:1))) entered as an array formula (Ctrl+Shift+Enter) in older versions.

Why does SUMIF return #SPILL! with a simple criteria?

If your criteria is a range (e.g., D2:D5) instead of a single value, SUMIF will return an array. Use a single cell for criteria, or wrap with SUMPRODUCT to force a single result.

How do I find the spill range that’s blocking my formula?

Click on the formula cell. Excel will show a blue border around the intended spill range. Any non-empty cell in that area is the blocker. You can also use the error checking tool (click the yellow warning icon) to see the exact obstruction.

Does #SPILL! happen in Excel 2019 or earlier?

No, dynamic arrays are only available in Microsoft 365 and Excel 2021. In older versions, you would get a #VALUE! error or need to enter array formulas with Ctrl+Shift+Enter.

Can I turn off dynamic arrays to avoid #SPILL!?

No, dynamic arrays are a core feature of Microsoft 365 and cannot be disabled. However, you can use the @ operator to force implicit intersection, which mimics legacy behavior for a single cell.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →