SUMIF #SPILL! error: why it happens and how to fix it
Updated · Checked on a live sheet · Excel and Google Sheets
The most likely fix
SUMIF spills when its criteria is a range, returning one total per row. If something is in the way, or the criteria is a whole column like E:E, you get #SPILL!. Use the criteria cell on the same row and fill down (SUMIF(E:E, E2, F:F)), or clear the cells the result needs.
Fix it yourself
The formula in J2 shows the problem. Edit it to the fixed version and watch the sheet recalculate.
| A | B | C | D | E | F | G | H | I | J | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Order | Date | Customer | Product | Category | Qty | Price | Status | Category total | |
| 2 | 1001 | 2 Mar 2026 | Mara Okafor | Monstera | Plants | 1 | $34.00 | Shipped | #SPILL! | |
| 3 | 1002 | 2 Mar 2026 | Jonas Lind | Terracotta pot | Pots | 3 | $12.50 | Shipped | ||
| 4 | 1003 | 3 Mar 2026 | Priya Raman | Snake plant | Plants | 2 | $22.00 | Shipped | ||
| 5 | 1004 | 4 Mar 2026 | Tomás Ruiz | Watering can | Tools | 1 | $18.00 | Pending | note | |
| 6 | 1005 | 5 Mar 2026 | Elif Demir | Fern | Plants | 4 | $9.50 | Shipped | ||
| 7 | 1006 | 5 Mar 2026 | Mara Okafor | Potting mix | Soil | 2 | $7.25 | Returned | ||
| 8 | 1007 | 6 Mar 2026 | Kenji Mori | Pruning shears | Tools | 1 | $24.00 | Shipped | ||
| 9 | 1008 | 7 Mar 2026 | Ines Varga | Ceramic pot | Pots | 2 | $19.00 | Pending | ||
| 10 | 1009 | 8 Mar 2026 | Jonas Lind | Monstera | Plants | 1 | $34.00 | Shipped | ||
| 11 | 1010 | 9 Mar 2026 | Sofia Rossi | Fern | Plants | 6 | $9.50 | Shipped | ||
| 12 | 1011 | 10 Mar 2026 | Priya Raman | Potting mix | Soil | 5 | $7.25 | Shipped | ||
| 13 | 1012 | 11 Mar 2026 | Leo Brandt | Snake plant | Plants | 1 | $22.00 | Pending |
Shows the problem
=SUMIF(E2:E13,E2:E13,F2:F13)Fixed
=SUMIF(E2:E13,E2,F2:F13)Causes, most likely first
1Something blocks the spill range
A criteria range gives one result per row, and those results need empty cells below the formula. A note, a value or an old formula in that range turns the whole result into #SPILL!. In Excel, selecting the error cell shows a dashed border around the range it needs, and Select Obstructing Cells jumps to what's in the way (Microsoft's #SPILL! page).
2The criteria is a whole column
SUMIF(A:A, A:A, B:B)asks for a total for every one of the sheet's rows. Microsoft's #SPILL! page explains the same case with VLOOKUP: a whole-column lookup value returns over a million results and hits the end of the grid. Use the value on the same row and fill down, or a bounded range.Wrong
=SUMIF(A:A,A:A,B:B)Fixed
=SUMIF(A:A,A2,B:B)3The formula is inside an Excel table
Microsoft lists “Table formula” as its own #SPILL! cause: spilled arrays aren't supported in Excel tables. Inside a table, use the one-row-at-a-time version,
SUMIF([Category], [@Category], [Qty])style, or move the formula outside the table.4You wanted one total per category, not per row
A spilled SUMIF repeats each category's total on every row of that category. For a summary, list each category once with UNIQUE and sum against the spilled list:
=UNIQUE(E2:E13)in J2, then=SUMIF(E2:E13, J2#, F2:F13)beside it. That needs Excel 2021 or later, or Microsoft 365.Wrong
=SUMIF(E2:E13,E2:E13,F2:F13)Fixed
=SUMIF(E2:E13,J2#,F2:F13)5COUNTIF and AVERAGEIF behave the same
COUNTIF, AVERAGEIF and the *IFS functions spill in exactly the same situations: a range as the criteria gives one result per value. A whole-column criteria hits the bottom of the sheet; the same three fixes apply.
Wrong
=COUNTIF(A:A,A:A)Fixed
=COUNTIF(A:A,A2)
Stop it happening again
Decide whether you want one result per row or one per category before you write the formula. Per row: the same-row criteria filled down works everywhere, including tables and older Excel. Per category: UNIQUE plus a SUMIF that points at the spilled list. Leave empty space below any formula that spills, and don't type into a spill range; select the formula cell to see the dashed border of the range it uses. When you open an older workbook in a newer Excel, look for whole-column criteria first: they're the most common source of new #SPILL! errors.
Questions
Why did an old workbook start showing #SPILL!?
Older Excel quietly used only the value on the formula's own row when SUMIF got a whole column as its criteria. Excel 2021, Excel 2024 and Microsoft 365 return every value instead, which runs off the sheet. The same-row version restores the old result.
Can I turn spilling off?
Not as a setting. Write formulas that return one value (the same-row criteria), or use the @ operator in front of a whole-column reference to ask Excel for one value the old way.
In Google Sheets
Google Sheets doesn't use #SPILL!; Google's list of error values (in its ERROR.TYPE help) doesn't include it, and we haven't found an official page that documents the exact error Sheets shows when an array result is blocked. We also haven't confirmed whether Sheets returns one SUMIF result per row from a range criteria without ARRAYFORMULA, so for shared files use the fill-down version, which works in both.
Why this happens
In Excel 2021, Excel 2024 and Microsoft 365, any formula that returns several values spills them into the cells around it. That turned some old formulas, written when SUMIF quietly used only the value on its own row, into #SPILL! errors. The #SPILL! error page covers every cause, and UNIQUE and SORT explains spill ranges and the # reference.
Sources
Official documentation the facts on this page were checked against.