Handling the SPILL Error
Diagnose and fix blocked spill ranges in your sheet.
Handling the SPILL Error is a free Excel Formulas Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Excel Formulas Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What the SPILL Error Means
When a dynamic array formula cannot lay out its full result, Excel shows #SPILL! in the anchor cell. The formula is usually correct; the problem is that something is in the way of where the results need to go.
Think of it like trying to park a bus in a space already holding a car. The bus is fine, but the spot is blocked.
Cause 1: Cells in the Way
The most common cause is that one or more cells in the spill range already contain data. If =UNIQUE(A2:A12) needs to fill C1:C3 but C2 holds a stray value, the spill is blocked.
The fix is simple: select the anchor cell, look at the dashed spill outline, and clear any cells inside it that are not empty.
=UNIQUE(A2:A12)Finding the Blocking Cell
Click the cell showing #SPILL!. Excel draws a dashed border around the area the result wants to occupy. Any non-empty cell inside that border is the culprit.
You can also click the warning triangle next to the cell and choose Select Obstructing Cells, which jumps straight to the offending cells so you can delete their contents.
Cause 2: Merged Cells
A spill range cannot overlap any merged cells. Even an empty merged cell counts as an obstruction because the spill needs separate, individual cells to fill.
If your output lands on a merged title bar or label, unmerge those cells (Home tab, Merge and Center toggle) and the formula will spill correctly.
Cause 3: Not Enough Room
A spill also fails if it would run off the edge of the worksheet or into a table. For example a formula near the bottom row that needs to spill downward has nowhere to go.
Move the formula higher or to a column with space below it. Make sure there are as many empty cells as the result needs in the spill direction.
Cause 4: Spilling Inside a Table
Excel Tables (created with Ctrl+T) do not allow dynamic arrays to spill inside them, because a table expects each cell to be editable.
If your spilling formula sits in a table column, you will get #SPILL!. Either convert the table back to a normal range (Table Design, Convert to Range) or move the formula outside the table.
Cause 5: Volatile or Full-Column References
Pointing a spilling formula at an entire column can also trigger #SPILL! because the result becomes enormous and may collide with other content or exceed limits.
For example =A:A*2 tries to spill a million rows. Restrict the reference to the actual data, like =A2:A100*2, so the spill has a manageable, well-defined size.
=A2:A100*2Reading the Error Tooltip
Hover over the warning triangle on a #SPILL! cell and Excel tells you exactly why. Common messages include Spill range isn't blank, Spill range has merged cells, and Spill range is too big.
Always read this tooltip first. It points you straight to the cause instead of guessing, and each message maps to one of the fixes you just learned.
Spill Errors Are Not Formula Bugs
It is important to remember that a #SPILL! error rarely means your formula logic is wrong. The calculation succeeded; only the placement failed.
Once you clear the obstruction, the same untouched formula spills perfectly. Compare this to #VALUE! or #REF!, which usually do signal a real problem inside the formula itself.
A Worked Fix
You type =SORT(UNIQUE(A2:A20)) in D1 and get #SPILL!. You select D1, see the dashed outline cover D1:D5, and notice an old note sitting in D3.
You delete the contents of D3. Instantly the formula spills the sorted distinct list down D1:D5. No edit to the formula was needed at all.
=SORT(UNIQUE(A2:A20))Preventing Spills Before They Happen
A little planning avoids most spill errors. Give your dynamic array formulas an empty column or area to grow into, and keep labels and notes away from the spill direction.
When you reference another spill, use the # operator like =SUM(D1#) so your formulas adapt as ranges resize. Build outputs in clear, open space and #SPILL! will rarely appear.
=SUM(D1#)Quick Check
Test your understanding of the SPILL error.
Recap: Handling the SPILL Error
You learned that #SPILL! is a placement problem, not a logic bug:
- Most often a cell in the spill range is not blank.
- Merged cells and Tables block spilling.
- Avoid full-column references that make the result too big.
- Use Select Obstructing Cells and the tooltip to find the cause.
That completes the Dynamic Arrays and Spilling course. You can now return many results from one formula and fix spills with confidence.
Frequently asked questions
Is the “Handling the SPILL Error” lesson free?
Yes — the full text of “Handling the SPILL Error” is free to read here on the web, and the Excel Formulas Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Excel Formulas Academy course, upgrade to CoddyKit PRO.
What will I learn in “Handling the SPILL Error”?
Diagnose and fix blocked spill ranges in your sheet. You practise Excel Formulas Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Excel Formulas Academy?
No prior experience is required. Excel Formulas Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Handling the SPILL Error” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Excel Formulas Academy lesson?
Yes. Every Excel Formulas Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- What Spilling Means
- Filtering Data With FILTER
- Removing Duplicates With UNIQUE
- Handling the SPILL Error