How to Use COUNTIF in Google Sheets (With Examples)

COUNTIF counts the cells that meet one condition. The syntax is =COUNTIF(range, criterion) — so =COUNTIF(A2:A100, "North") counts how many cells in column A say “North”. When you need more than one condition, use COUNTIFS.

The two arguments

ArgumentWhat it isExample
rangeThe cells to checkA2:A100
criterionWhat to match"North"

That’s the whole function. The criterion is where the flexibility — and the confusion — lives.

Worked examples

Count text matches:

=COUNTIF(A2:A100, "North")

Count numbers above a threshold:

=COUNTIF(B2:B100, ">500")

Count blank cells:

=COUNTIF(A2:A100, "")

Count non-blank cells:

=COUNTIF(A2:A100, "<>")

Count cells containing part of a word (wildcard):

=COUNTIF(A2:A100, "*west*")

The criteria rules worth memorising

This is where most COUNTIF mistakes happen:

To matchWrite it as
Exactly “North”"North"
Greater than 500">500"
Greater than or equal to 500">=500"
Not equal to “North”"<>North"
Blank""
Not blank"<>"
Starts with “Nor”"Nor*"
Ends with “west”"*west"
Contains “orth”"*orth*"
A value in another cell">"&E2

Operators go inside the quotes. Cell references go outside. That last row — ">"&E2 — is the trick for a condition driven by a cell rather than typed in.

Case sensitivity: COUNTIF is not case-sensitive. “north” and “North” both count. (For case-sensitive counting you’d need SUMPRODUCT with EXACT.)

COUNTIFS: several conditions at once

COUNTIFS takes pairs — each range followed by its criterion:

=COUNTIFS(A2:A100, "North", C2:C100, "Q1")

That counts rows where column A is “North” and column C is “Q1”. Add more pairs for more conditions — up to 127.

All conditions must be true for a row to count (it’s AND, not OR). To count either of two conditions, add two COUNTIFs together: =COUNTIF(range,"North") + COUNTIF(range,"South").

Counting vs. summing

These three functions get mixed up constantly:

FormulaWhat it does
COUNTIFCounts cells matching a condition
SUMIFAdds up cells matching a condition
COUNTACounts non-empty cells, no condition

So “how many sales in the North region” is COUNTIF; “what’s the total value of North sales” is SUMIF. If you need the summing version, see how to use SUMIF in Excel — the logic is the same.

A useful pattern: count and total together

To show “12 of 40 items are complete”:

=COUNTIF(B2:B41, "Done") & " of " & COUNTA(B2:B41)

That combines a count with a total into one readable cell, and it updates as the data changes. Pair it with checkboxes — see how to add checkboxes in Google Sheets — and it becomes a live progress line.

Counting unique values

COUNTIF counts occurrences, not distinct values. To count unique entries:

=COUNTUNIQUE(A2:A100)

Or use =SUMPRODUCT(1/COUNTIF(A2:A100, A2:A100)) for a count of distinct values in a range containing blanks-free data.

Common problems

ProblemFix
Returns 0 when there are matchesOften a trailing space, or a number stored as text. Try =COUNTIF(ARRAYFORMULA(TRIM(A2:A100)), "North")
#ERROR! or a formula errorThe quotes are missing — text criteria need "like this"
Numbers not countingThe cells hold text, not numbers. Left-aligned values are usually text
Only some rows countedThe range stops short of the data
Criteria with a > doesn’t workThe operator must be inside the quotes: ">500", not > "500"
COUNTIFS counts too fewAll conditions must match — check each range covers the same rows

FAQ

What does COUNTIF do in Google Sheets?

It counts the cells in a range that match one condition. =COUNTIF(A2:A100, "North") counts how many say “North”.

What’s the difference between COUNTIF and COUNTIFS?

COUNTIF takes one condition; COUNTIFS takes several, and a row must match all of them to be counted.

How do I count cells greater than a number?

Put the operator inside the quotes: =COUNTIF(B2:B100, ">500"). To use a cell value instead, write =COUNTIF(B2:B100, ">"&E2).

Is COUNTIF case sensitive?

No. “North” and “north” both count. Case-sensitive counting needs SUMPRODUCT with EXACT.

How do I count cells that contain specific text?

Use wildcards: =COUNTIF(A2:A100, "*north*") counts any cell containing “north” anywhere. "north*" matches only cells starting with it.