Sub topic 7
Understanding and fixing #SPILL!
This chapter assumes you can enter and edit formulas, use cell and range references, and have Excel for Microsoft 365 or Excel 2021 or later. You should also know what an anchor cell and a spill range are from the previous chapter.
What the error means
A formula that returns several values needs a clear block of cells to fill. Excel works out the size of that block when it calculates. If any cell in the block cannot be used, Excel shows #SPILL! in the anchor cell and writes nothing into the neighboring cells.
The formula itself is usually correct. The error is about the space around it.
Walkthrough: a blocked spill
Enter this formula in E2:
=SEQUENCE(5)It needs E2:E6. Now type any value, even a single space, in E4 and look at E2. It shows #SPILL!. Click E2 and an error indicator appears. A dashed border outlines the cells Excel wanted to fill. Delete the value in E4 and the spill returns.
Common causes and fixes
Select the anchor cell, open the error indicator, and read the first line. It names the cause. The table lists the usual ones.
| Message | Cause | Fix |
|---|---|---|
| Spill range isn't blank | A cell in the range holds a value, a formula, or a space | Clear or move the blocking cell |
| Spill range has merged cells | A merged cell lies in the range | Unmerge the cells |
| Spill range is in a table | Excel tables cannot hold spilled results | Put the formula outside the table |
| Spill range is too big | The result runs past the edge of the sheet | Reduce the result or reference fewer rows |
| Unknown spill range size | Excel cannot predict the size, as with some volatile functions | Make the size fixed or predictable |
The indicator menu also has Select Obstructing Cells. Use it when the blocker is far away or hidden, such as a cell that only contains a space or has white text.
Too big and unknown size
Referencing whole columns can cause the too-big message. Compare these two formulas:
=A:A*2=A2:A100*2The first returns more than a million rows. It spills only from row 1 and only if the column below is entirely clear, so it usually fails or wastes calculation. The second returns 99 values and is predictable. Prefer bounded ranges, or a spill reference such as E2#, when the source can grow.
Functions that make the result size depend on something Excel cannot determine in advance can trigger the unknown-size message. Rewriting the formula so the size comes from a fixed range or constant removes it.
Spill errors in tables and merged areas
Excel tables do not accept dynamic array formulas. If you convert a range to a table and a spill formula is inside it, you get #SPILL!. Keep the formula on the sheet beside the table and refer to the table columns by name.
Merged cells behave the same way. Even one merged cell inside the target block stops the spill.
A repeatable checklist
- Click the anchor cell and read the error message.
- Look at the dashed outline to see the intended range.
- Use Select Obstructing Cells if the blocker is not visible.
- Clear, move, or unmerge the blocker, or move the formula.
- If the size is the problem, limit the ranges used.
Exercise
E2 holds =SORT(A2:A8) and shows #SPILL!. The indicator says "Spill range isn't blank", and E2:E8 looks empty. What do you do to find the cause?
Show answer
Select E2, open the error indicator, and choose Select Obstructing Cells. Excel selects the occupied cell, which may contain a space, an empty-string formula, or white text. Clear that cell and the sorted list spills into E2:E8.
Exercise
You turn the range holding =UNIQUE(A2:A20) into an Excel table and get #SPILL!. Why, and what is the fix?
Show answer
Excel tables cannot contain spilling formulas. Move the formula to a cell outside the table, and refer to the table's columns from there.