If a formula returns #SPILL!, Excel is telling you one thing: the formula works, but it cannot place all its results because something is in the way. Spills happen when a dynamic array formula (like FILTER, UNIQUE, SORT, SEQUENCE or a range reference such as A2:A20) produces more than one result, and Excel needs empty cells below or beside the formula to pour those results into. If any of those cells contain data, or the results would run off the edge of the sheet, or you put the formula inside an Excel Table, Excel shows #SPILL! instead of answers. The fastest fix is almost always to clear the cells blocking the spill, or to wrap the formula in something that stops it from returning multiple values.

What You'll Need

  • Excel for Microsoft 365, Excel 2021, Excel 2024, or Excel for the web. Spilled arrays do not exist in Excel 2019 or older, and in those versions FILTER, UNIQUE, SORT and the like are not available at all.
  • A formula you know should return more than one value, or a cell that already shows #SPILL!
  • A few empty rows and columns to the right and below the formula

One note before you start: Excel for Mac and Excel for the web support spilled arrays, but Excel on iPad and iPhone behaves differently in some cases, and some menus differ. The steps below describe the desktop app; labels can differ slightly by version, device or region.

Step-by-Step

  1. Select the cell showing #SPILL! and look at the formula bar. If the formula references a range, contains FILTER, UNIQUE, SORT, SORTBY, SEQUENCE, RANDARRAY or TEXTSPLIT, or uses a whole column like A:A, it is a dynamic array formula and is expected to return more than one value.
  2. Look for the dashed border. When a spill is blocked, Excel often draws a dashed outline where the results would have gone. That outline shows you exactly which cells are causing the problem.
  3. Clear the blocking cells. Click inside the dashed area, find the cell that holds text or numbers, and either delete its contents, move it elsewhere, or use Insert > Cells to shift it out of the way. You cannot simply hide a row or column to fix a blocked spill; the cells must actually be empty.
  4. Check for merged cells. A merged cell anywhere inside the spill range blocks the whole spill. Select the area and use Home > Merge & Center to unmerge it, then try again.
  5. Move the formula away from a Table. Even an empty Excel Table row blocks a spill, because Excel treats every cell in a table as occupied. Either place the formula outside the table or convert the table to a normal range (right-click the table > Table > Convert to Range).
  6. Make room at the edges. If the formula is in row 1,048,576 or the last column, there is no room to spill. Move the formula higher up or further left; a VLOOKUP returned with XLOOKUP's range or a SEQUENCE of 2,000 numbers in the final row will always fail.
  7. Re-enter the formula and press Enter. Do not press Ctrl+Shift+Enter. That combination turns the formula into a legacy array formula in a single cell and stops it spilling. A modern dynamic array formula needs a plain Enter.
  8. Confirm the spill works. When it does, the results appear and are surrounded by a thin blue border. Click any cell in that block and the formula bar shows the formula only in the top-left cell; if you click the whole spilled range, Excel appends the # operator, for example =A2#, which is a handy reference to the whole spill.

Common Mistakes

  • Typing something into a spilled range. If you click a cell inside a spill and type, Excel rejects it with a warning that you cannot change part of an array. Enter the value somewhere else, or change the formula.
  • Trying to drag-fill a spilled formula down. That corrupts the spill into individual cells and can produce #SPILL! warnings or a legacy array. Just enter the formula once; it fills the area itself.
  • Using Ctrl+Shift+Enter out of habit. Entering a single-cell array formula the old way tells Excel you only want one cell, so the spill never appears.
  • Assuming #SPILL! means a broken formula. It almost never does. The formula's logic is fine; the sheet layout is not.
  • Not realising a worked example is blocked. For example, =UNIQUE(B2:B100) placed in a column whose neighbouring cells contain notes will fail even though the function is correct.

Tips

  • Leave a few empty rows and columns below and beside every dynamic formula. That is free rehearsal space for the spill.
  • Reference whole columns carefully. =FILTER(A2:A1000, B2:B1000="Open") is easier to place than =FILTER(A:A, B:B="Open"), because the former is easier to keep clear.
  • To turn a multi-value spill into one value, wrap the formula in INDEX, for example =INDEX(FILTER(A2:A100, B2:B100="Open"),1), or use an aggregation like SUM or COUNTA around the spill result. That prevents the spill entirely and avoids #SPILL!.
  • Use the # operator to reference a whole spill in another formula (=COUNTA(A2#)), so the count updates as the spill grows or shrinks.
  • Format the top-left cell of a spilled range and Excel applies that formatting to the spill results automatically. If you need individual formatting, spill results can't be formatted individually; overwrite them with values first.
  • Use =SEQUENCE(10) as a quick test. If that spills ten numbers on a blank sheet, dynamic arrays are working and the problem is layout, not Excel.

Troubleshooting

If you cleared the obvious cell and still get #SPILL!, work through these in order:

  1. Inspect the whole dashed border. The blocking item may be off-screen in a wider or taller spill than you assumed.
  2. Search the surrounding block for merge and comments. Use Home > Merge & Center to check for merged cells, and look for notes (yellow) or comments (purple) in the area.
  3. Check for a Table. Click inside the range and see whether the Table Design tab appears. If so, the formula is inside a table and must be moved out.
  4. Check hidden rows and columns. Hiding does not create room. Select the whole sheet and press Ctrl+Shift+9 to unhide columns, or use Format > Hide & Unhide > Unhide Columns.
  5. Confirm the formula is truly dynamic. Select it and look for curly braces { } in the formula bar. Braces mean it is a legacy array formula; re-enter it with Enter, not Ctrl+Shift+Enter.
  6. Test in a fresh sheet. Paste the formula into a brand-new worksheet. If it spills there, the original sheet is the problem; if it fails there too, something about the formula or version is wrong.
  7. Update Excel. If functions like FILTER are not recognised at all, you are probably on an older perpetual version. Dynamic arrays require Microsoft 365, Excel 2021 or later, or Excel for the web.

Frequently Asked Questions

What does #SPILL! actually mean?

It means the formula returned more than one result, but Excel could not write those results into the cells below or beside it because at least one target cell is not empty, or the results would leave the sheet. Clear the blockage and the spill appears.

Why does my formula spill when I only wanted one answer?

Most likely the formula references a range that returns multiple values, like a whole column. Wrap it in INDEX, SUM, XLOOKUP or another function that returns a single value, or use implicit intersection operators where appropriate.

Can I stop a formula from spilling on purpose?

Yes. Put an @ symbol before the range in the formula (for example =@A2:A20) or wrap it in a function that reduces the result to a single value. The formula then returns only the value from the same row.

Does #SPILL! appear in Google Sheets?

Google Sheets uses a similar mechanism but shows its own array formula behaviour and error messages, so the exact wording differs. The principle is the same: clear the cells where the results need to go.

Will spilled results survive if I copy the sheet to an older Excel?

No. Spilled ranges and functions like FILTER and UNIQUE are not supported in Excel 2019 or earlier, so copy the values instead if the file has to open there.

Why does the spill break after I add rows above it?

Inserting rows pushes the formula down but can leave data in the spill area. Recheck the dashed border and clear whatever new content now sits inside it.