An Excel spill error, shown as #SPILL!, means a formula that returns multiple results cannot place them all in the worksheet. Select the formula cell, then clear or move whatever is blocking its spill range; if the formula is inside an Excel Table or the result would run off the sheet, move or adjust the formula instead.
What the spill error means
In Microsoft 365 Excel, some formulas return an array of values rather than a single value. Excel puts the formula in one cell—the top-left, or anchor, cell—and displays the other results in adjacent cells. That output area is called the spill range. A spill error appears when Excel cannot put the full result in the cells it needs.
Dynamic array formulas can return several rows, several columns, or both. For example, a filter can return every matching row from a list, and a sorting formula can display a reordered set of records. The formula is entered once, in the anchor cell; the other output cells are filled automatically. They are not separate formulas to copy down.
This is different from an ordinary formula error such as #VALUE!. A spill error usually does not mean the formula’s calculation is invalid. It means Excel cannot display the requested result in the current layout. The formula bar still shows the formula in the anchor cell, and the outlined area indicates where Excel expects the results to appear.
How to find and remove the obstruction
Start with the anchor cell showing #SPILL!. Select it and inspect the outlined spill area. A cell that looks blank may still contain a space, an empty string returned by a formula, or another value that prevents the result from being placed there. The error menu may describe the particular cause, such as a blocked range or a merged cell.
- Select the cell containing
#SPILL!and look at the proposed spill range. - Check every cell in that area for values, formulas, spaces, or merged cells.
- Move or remove the conflicting content if it is safe to do so. To remove cell contents in Excel for Windows, select the cells and press Delete; this keeps the cells themselves in place.
- If the existing content must stay, move the formula to an area with enough empty cells or change the formula so it returns a smaller result.
Do not delete a whole row or column just to clear a blockage unless you intend to shift or remove the worksheet’s other data. If the obstruction is a formula result that currently displays an empty string, clearing the formula may affect other calculations. Check what the cell is used for before changing it.
Common causes of #SPILL!
- Occupied cells: A value, formula, or space is in one or more cells where the result needs to go. A cell containing a formula that displays an empty string can still count as occupied.
- Merged cells: A spill range cannot include merged cells. Unmerge the affected cells, or put the formula somewhere its output will not cross a merged area.
- Formula entered in a Table: Dynamic array formulas cannot spill from within an Excel Table. Put the formula outside the table, or change the table layout if that is appropriate. A formula outside a table can still refer to table data.
- Output would extend beyond the worksheet: Excel cannot spill a result past the last row or column. Move the formula to a location with enough room or reduce the result.
- Result size cannot be determined: Some formulas that produce a variable-size array depend on changing calculations. If Excel cannot establish the size of the output, it may report a spill error. Simplifying the formula or using a stable input range can help.
- Very large array: A formula may request more results than Excel can handle in the available worksheet context. Narrow the input range or return only the rows and columns needed.
Spill errors with FILTER and other dynamic array formulas
Functions such as FILTER, SORT, UNIQUE, and SEQUENCE can return arrays in Microsoft 365 and Excel 2021 or later. They are useful for reports that update when source data changes, but the output area must remain available. If a source list grows, a previously working formula may need more rows and begin to collide with notes or other calculations.
For example, with product names in A2:A10 and their status in B2:B10, enter the following formula in D2. It returns the product names whose status is Open, or the text No matches if no rows qualify:
=FILTER(A2:A10,B2:B10="Open","No matches")
Before using this example, make sure D2 and the cells below it are available for the results. If the formula matches four products, Excel displays four names beginning at D2. If D5 contains an unrelated value, the output cannot occupy all four cells and the anchor may show #SPILL!. Clear or move the obstruction, or place the formula in a clear column.
Some functions can also return a horizontal array. In that case, check cells to the right as well as below the anchor. The outline around the intended spill area can help reveal whether the formula needs rows, columns, or both.
Why formulas inside Excel Tables behave differently
Excel Tables automatically extend formulas down a column as calculated columns. That behavior differs from a dynamic array formula, which needs to spill its results into neighboring cells. Consequently, entering a multi-result formula inside a table can produce a spill error rather than a visible array.
A common solution is to put the dynamic array formula in an empty worksheet area outside the table. Keep the source data in the table if useful; the formula can refer to that data. Another option is to change the table to a normal range using Table Design > Convert to Range, but that removes table features such as automatic expansion and structured references. Consider those effects before converting.
When the result itself is too large
Sometimes the spill range is not blocked; it is simply bigger than the available space. A formula near the bottom of a worksheet may need more rows than remain. A formula near the right edge may need more columns. Move it to a location with sufficient room, or adjust the source data and criteria so the result is smaller.
For instance, with numbers in A1:A5, enter this formula in C1 to request five consecutive numbers:
=SEQUENCE(5)
It returns 1, 2, 3, 4, and 5 in C1:C5. If the anchor were placed in one of the last four worksheet rows, there would not be enough rows beneath it for the complete result. Moving the formula upward resolves that layout problem; changing the sequence length is another option if fewer results are required.
How to prevent the error in shared or changing worksheets
Spill errors often appear after a sheet is edited, even if the formula worked before. Someone may type into the future output area, paste a block of data over part of it, merge cells for formatting, or add enough source records to enlarge the array. A formula’s spill range is therefore part of the worksheet’s layout, not just a calculation detail.
- Reserve a clearly empty area for dynamic-array results, away from manual notes and input cells.
- Keep spill formulas outside Excel Tables and avoid merging cells in their expected output areas.
- When a source list can grow, leave more room than the current result needs.
- Explain to collaborators which cells are generated output, so they do not type into the spill area.
- After changing a formula or its source data, check that the complete result appears and that the anchor no longer shows an error.
These steps are especially helpful in shared workbooks, where another user may not know that a blank-looking region is reserved for formula output. Protecting or clearly labeling generated areas can reduce accidental edits, but protection settings should be chosen to suit the workbook’s other editing needs.
Spill errors versus related Excel behavior
A spill error is not the same as the #CALC! error that can occur when a calculation itself cannot produce a usable result. For example, FILTER can return #CALC! when there are no matches and no optional value for that case is supplied. By contrast, a #SPILL! message points to a problem displaying an array in the worksheet. The error text and the formula’s behavior help distinguish them.
It is also normal to see only one formula in the formula bar for a multi-cell result. The anchor owns the formula; the remaining cells are spill outputs. Editing one of those output cells is not the way to change an individual result. Change the anchor formula or the source data instead. In versions of Excel without dynamic array support, newer array formulas may behave differently or may not be available, so check the Excel version if a workbook is opened on another computer.
Frequently Asked Questions
How do I fix a #SPILL! error in Excel quickly?
Select the cell with the error, inspect the outlined spill range, and clear or move anything occupying the required cells. If the cause is a merged cell, a Table, or insufficient worksheet space, adjust the layout or relocate the formula.
Why does Excel show #SPILL! when the cells look empty?
A cell may contain a space, a formula, or a formula result that displays as an empty string. Check the cells in the outlined range rather than relying only on what is visible. The error menu may also identify a merged cell or another cause.
Can I use a spill formula inside an Excel Table?
A dynamic array formula cannot spill from inside a Table. Place it outside the Table, leaving enough empty cells for the result. The formula can still use the Table as its data source.
Can I delete the cells showing the spill results?
The output cells are generated by the formula in the anchor cell, so they are not independent formula cells. To change the output, edit the anchor formula or its inputs. To remove the entire result, clear the formula in the anchor cell.
Does #SPILL! mean my formula is wrong?
Not necessarily. It usually means Excel cannot display the formula’s array in the required cells. A blocked cell, merged range, Table placement, or worksheet edge can cause it even when the formula’s calculation is otherwise valid.
Related
- Merge Cells but Keep All Data in Excel: What Works
- Merge Cells in Excel: How to Keep All Your Data
- Merge Cells and Keep Both Values in Excel Without Data Loss
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Errors & fixes
- VLOOKUP Not Working? Fix Common Excel Lookup ErrorsIf VLOOKUP is not working, first check that the lookup value is in the leftmost column of the…
- Can’t Add Page Numbers in Word? Fix the Common CausesYes—you can add page numbers in Word from Insert > Page Number, then choose a position and style.…
- Excel #NUM! Error: Causes, Meaning, and How to Fix ItExcel’s #NUM! error means a formula has an invalid numeric value or cannot complete a calculation with the…
- Excel HLOOKUP Not Working? Fix Lookup and Match Errors NowIf HLOOKUP is not working, first check that the value you want to find is in the first…
- Excel Insert Page Break Not Working? Fixes That HelpIf Excel’s Insert Page Break command is unavailable or the break does not appear where you expect, first…
- Why Is AVERAGE Not Working in Excel?Excel’s AVERAGE function usually appears not to work because the selected range contains numbers stored as text, an…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.