Formula Fixer

How to Fix the #SPILL! Error in Excel (and Google Sheets)

Updated 2026-11-27

TL;DR: #SPILL! means a formula that returns several results (FILTER, UNIQUE, SORT, SEQUENCE or a range lookup) cannot place them in the cells next to it. Most often something is already in the way: click the error, choose Select Obstructing Cells, and delete or move what is there. Other causes listed by Microsoft are merged cells, a formula inside an Excel table, a whole-column reference that runs off the end of the sheet (fix with A2:A100, one cell copied down, or the @ operator) and a result whose size keeps changing. Google Sheets shows #REF! with the message 'Array result was not expanded because it would overwrite data in' a cell instead.

Newer versions of Excel (Microsoft 365, Excel 2021 and later, and Excel for the web) let one formula fill a whole block of cells. Microsoft calls this spilling. When the block cannot be filled, you get #SPILL!. The good news: the error always means the formula itself works, and the fix is usually about the cells around it.

What #SPILL! means

A formula such as =UNIQUE(A2:A20) or =FILTER(A2:C50,C2:C50>100) returns several values. You type it in one cell and Excel fills the cells below and to the right. If it cannot, it shows #SPILL! in the formula cell and draws a dashed border around the area it wanted to use.

Causes and fixes at a glance

What the error says (Excel)Why it happensFix
Spill range isn't blankSomething is in the cells the result needs: a value, a space, a formula returning ""Click the error, choose Select Obstructing Cells, then delete or move what is there
Spill into merged cellsThe result would land on merged cellsUnmerge the cells or move the formula
Table formulaDynamic array formulas are not supported inside an Excel tableMove the formula outside the table, or convert the table to a range (Table Design > Convert to Range)
Extends beyond the worksheet's edgeA whole-column reference such as =VLOOKUP(A:A,A:C,2,FALSE) tries to return 1,048,576 resultsReference only the rows you need, use one cell and copy down, or add @ for implicit intersection
Indeterminate sizeThe size of the result keeps changing, for example =SEQUENCE(RANDBETWEEN(1,1000))Make the size fixed, or calculate the random number in its own cell first
Out of memoryThe result is too largeReference a smaller range

Click the cell with the error and open the warning icon next to it: it names which of these causes Excel found.

1. Something is in the way (spill range isn't blank)

This is the cause nine times out of ten. A leftover value, an old formula, a single space or a formula that returns "" all count as "not blank". Click the #SPILL! cell, open the warning icon and choose Select Obstructing Cells; Excel jumps to them. Delete or move them and the formula spills straight away. If you copied an old formula down a column and then replaced it with one spilling formula at the top, clear the old copies below.

2. Merged cells in the spill area

Spilled results cannot land on merged cells. Unmerge them (Home > Merge & Center > Unmerge Cells) or move the formula to an area without merges. If you merged cells only for looks, Center Across Selection gives the same look without merging.

3. The formula is inside an Excel table

Spilling formulas are not supported inside tables. Either put the formula next to the table, outside it, and refer to the table with structured references such as =UNIQUE(Table1[Customer]), or convert the table to a normal range with Table Design > Convert to Range.

4. Whole-column references (VLOOKUP and others)

In older Excel, =VLOOKUP(A:A,A:C,2,FALSE) in E2 quietly looked up only A2. In dynamic-array Excel it looks up every cell in column A, tries to return 1,048,576 results and hits the bottom of the sheet. Microsoft gives three fixes:

Only the rows you need (spills):     =VLOOKUP(A2:A7,A:C,2,FALSE)
One row, then copy down (no spill):  =VLOOKUP(A2,A:C,2,FALSE)
Implicit intersection (no spill):    =VLOOKUP(@A:A,A:C,2,FALSE)

The second and third versions also work inside tables. For new sheets, XLOOKUP is usually the cleaner choice.

5. The result keeps changing size

=SEQUENCE(RANDBETWEEN(1,1000)) asks for a random number of rows, and the number changes on each calculation pass, so Excel gives up with #SPILL!. Microsoft notes this is generally linked to RAND, RANDARRAY and RANDBETWEEN. Put the random number in its own cell and refer to it, or paste it as a value.

The @ sign Excel adds to old formulas

If you open an older workbook, Excel may show formulas like =@A:A. The @ is the implicit intersection operator: it keeps the old one-value behaviour so the formula does not suddenly spill. Leave it in unless you want the formula to return a whole range.

Google Sheets: "Array result was not expanded"

Google Sheets uses the same idea for FILTER, UNIQUE, SORT, QUERY, SPLIT and ARRAYFORMULA, but the error shows as #REF!. Hover over it and the message reads "Array result was not expanded because it would overwrite data in" followed by a cell address, such as D5. Go to that cell, delete what is there (check for spaces and formulas that return ""), and the result appears. Merged cells in the way cause the same error. Google Sheets never overwrites data to make room.

How to avoid #SPILL! in the first place

Quick FAQ

What does #SPILL! mean in Excel? A formula that returns several values cannot place them, usually because cells it needs are not empty.

How do I fix #SPILL! quickly? Click the error, open the warning icon, choose Select Obstructing Cells and clear those cells.

Why does my VLOOKUP give #SPILL!? It refers to a whole column such as A:A as the lookup value. Use A2 and copy down, a fixed range such as A2:A100, or @A:A.

Can I use spilling formulas in an Excel table? No. Put them outside the table or convert the table to a range.

What is the Google Sheets version of #SPILL!? #REF! with the message "Array result was not expanded because it would overwrite data in" a named cell.

More error fixes: #VALUE! error, #N/A error and the FILTER function.

Sources: Microsoft Support: How to correct a #SPILL! error; Microsoft Support: Dynamic array formulas and spilled array behavior; Microsoft Support: Implicit intersection operator @.

Prefer a ready-made file?

Related: How to Remove or Highlight Duplicates in Excel and Google Sheets · INDEX MATCH Explained: Lookups Left, Right and 2-Way

Templates we sell: see all downloads and prices.

← More guides