formulastreak

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 note in J5 sits in the cells the spilled totals need · edit J2 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultJ2 = #SPILL!
ABCDEFGHIJ
1OrderDateCustomerProductCategoryQtyPriceStatusCategory total
210012 Mar 2026Mara OkaforMonsteraPlants1$34.00Shipped#SPILL!
310022 Mar 2026Jonas LindTerracotta potPots3$12.50Shipped
410033 Mar 2026Priya RamanSnake plantPlants2$22.00Shipped
510044 Mar 2026Tomás RuizWatering canTools1$18.00Pendingnote
610055 Mar 2026Elif DemirFernPlants4$9.50Shipped
710065 Mar 2026Mara OkaforPotting mixSoil2$7.25Returned
810076 Mar 2026Kenji MoriPruning shearsTools1$24.00Shipped
910087 Mar 2026Ines VargaCeramic potPots2$19.00Pending
1010098 Mar 2026Jonas LindMonsteraPlants1$34.00Shipped
1110109 Mar 2026Sofia RossiFernPlants6$9.50Shipped
12101110 Mar 2026Priya RamanPotting mixSoil5$7.25Shipped
13101211 Mar 2026Leo BrandtSnake plantPlants1$22.00Pending

Shows the problem

=SUMIF(E2:E13,E2:E13,F2:F13)

Fixed

=SUMIF(E2:E13,E2,F2:F13)

Causes, most likely first

  1. 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).

  2. 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)
  3. 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.

  4. 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)
  5. 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.

Practise this in 5 minutes

SUMIF is taught in Lesson 39: UNIQUE and SORT (Unit 11, Dynamic arrays), on a live sheet with instant feedback. Pro

Open “UNIQUE and SORT”

Get the formulastreak newsletter

Bite-sized formula tips you can use at work the next day, plus a heads-up when new free tools and lessons land. It arrives now and then, never in a flood.

No spam, unsubscribe in one click. We store your email, this consent and when you gave it. Details in our privacy policy.

Need a quick reference? The formula cheat sheet is free to read and print.