How to Use SUMIF & COUNTIF in Google Sheets
Add up or count only the rows that match a condition — sales in one region, tasks marked done — and stack several conditions with SUMIFS and COUNTIFS. Here's the syntax and the traps.
The quick version: =COUNTIF(B:B, "West") counts the West rows; =SUMIF(B:B, "West", C:C) totals column C for them. For more than one condition, use SUMIFS / COUNTIFS. Details below.
One condition — SUMIF / COUNTIF
=COUNTIF(B:B, "West")
=SUMIF(B:B, "West", C:C)
COUNTIF takes (range, criterion). SUMIF takes (range, criterion, sum_range) — the column you're adding comes last. Operators go in quotes: =SUMIF(C:C, ">1000").
Several conditions — SUMIFS / COUNTIFS
Watch the argument order: SUMIFS puts the sum column first, then range/criterion pairs.
=SUMIFS(C:C, B:B, "West", D:D, ">1000")
=COUNTIFS(B:B, "West", D:D, ">1000")
💡 Pro tip: many people just use
SUMIFS / COUNTIFS everywhere, even for a single condition. The argument order stays consistent and adding another criterion later is a one-line change, not a rewrite.Why you get 0 or the wrong number
- Numbers stored as text won't match
">1000". - Trailing spaces —
"West "≠"West". - Range sizes must line up in SUMIFS/COUNTIFS.
💬 Skip the formula: if the conditions keep stacking, ask instead of building the formula:
=QUIRIZ("count deals in the West region over $1,000", "short") returns the number, no quote-marks or argument order to get right.Skip the nested formula
Ask "total sales in the West over $1,000" in plain English and get the number in the cell with =QUIRIZ(). Free to start.
Try Quiriz free →Frequently asked questions
What is the difference between SUMIF and SUMIFS?
SUMIF adds a column for rows meeting one condition. SUMIFS handles multiple conditions at once (all must be true). The argument order differs: SUMIF is (range, criterion, sum_range) while SUMIFS is (sum_range, range1, criterion1, range2, criterion2, …).
How do I count with multiple criteria in Google Sheets?
Use COUNTIFS with one range-and-criterion pair per condition: =COUNTIFS(B:B, "West", D:D, ">1000") counts rows where column B is West and column D is over 1000.
Why is my SUMIF returning 0?
Common causes: numbers stored as text (so ">1000" never matches), trailing spaces in the criterion, or the range and sum_range being different sizes. Clean the data and make sure the ranges line up.
Can SUMIF use partial matches?
Yes, with wildcards. =SUMIF(A:A, "*west*", C:C) sums where column A contains "west". Use * for any characters and ? for a single character.