FormulaCraft

Fix the 0 error

Excel & Google Sheets
Topic:SUMIF & SUMIFS

What 0 means

When SUMIF returns 0, it usually means the criteria did not match any rows, so there was nothing to sum — but the formula is silently treating every comparison as false. This is different from an error: the formula runs successfully but finds no matches, or matches rows whose sum_range cells contain text numbers that do not add up.

Common causes

Example fix

Broken
=SUMIF(B2:B100,"Apples",C2:C100)
Fixed
=SUMIF(B2:B100,TRIM("Apples"),C2:C100)

In this case TRIM removes any trailing space in the criteria literal; the same fix should be applied to source data if spaces are embedded in B2:B100 using a helper column or TRIM in an array context.

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How to fix it

  1. 1Check whether sum_range values are real numbers: select a cell and look at the alignment (text left-aligns, numbers right-align by default) or use =ISNUMBER(B2). Convert text-numbers with Paste Special > Multiply in Excel, or =VALUE(B2) in a helper column.
  2. 2Make sure the criteria type matches the range type. If the range has text '42' use criteria "42"; if it has the number 42 use criteria 42 without quotes.
  3. 3Use TRIM on the criteria: wrap the criteria cell reference in TRIM(A2) to eliminate leading/trailing spaces.
  4. 4Ensure criteria_range and sum_range are the same dimensions. Both should cover the same number of rows, e.g. $B$2:$B$100 and $C$2:$C$100.
  5. 5Put comparison operators inside a quoted string: =SUMIF(B:B,">10",C:C) — not =SUMIF(B:B,>10,C:C) which is a syntax error.

Stop hunting errors by hand.

Upload your spreadsheet and the Auditor flags every 0 and broken formula at once — or paste this one formula and get the fix explained.

Frequently asked

SUMIF was working yesterday and returns 0 today — what changed?

The most common cause is new data pasted from an external source where numbers arrive as text. Check the newest rows: select a cell in the sum_range and press Ctrl+1 in Excel or check Format > Number in Sheets to see the format.

Can I use SUMIF with partial text matches?

Yes. Use wildcards in the criteria: =SUMIF(B:B,"*apple*",C:C) matches any cell containing the word apple. The * wildcard matches any number of characters.

My criteria is a date — why does SUMIF return 0?

Dates stored as text in the criteria_range will not match a real date criteria value. Ensure the criteria_range stores real dates (formatted as dates, not text) and pass the criteria as a DATE() function or cell reference, not a text string.

More on SUMIF & SUMIFS

See all →

Related formulas

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: