Templates, guides & honest tool reviews for small business

Sunday, November 29, 2026

COUNTIF Function in Google Sheets: Count with Conditions

COUNTIF function in Google Sheets: count cells with a condition
Illustration: COUNTIF function in Google Sheets

The COUNTIF function in Google Sheets counts the cells in a range that meet one condition, such as every row marked "Paid" or every number above 100. This guide shows the syntax, the operators, wildcards, how to count between two values and how to count with several conditions. All the sample data is made up.

COUNTIF syntax

=COUNTIF(range, criterion)

The range is where Sheets looks. The criterion is what it looks for. If A2:A10 lists order statuses, this counts the cells that say Paid:

=COUNTIF(A2:A10, "Paid")

Text criteria are not case sensitive, so "paid" and "Paid" give the same result.

COUNTIF in Google Sheets with a greater than operator
Operators go inside quotes (illustration).

Count numbers with operators

Put the operator inside quotes, directly before the number:

  • =COUNTIF(B2:B10, ">100") counts values above 100.
  • =COUNTIF(B2:B10, "<=50") counts values of 50 or less.
  • =COUNTIF(B2:B10, "<>0") counts values that are not zero.
COUNTIF in Google Sheets with a wildcard to count cells containing text
Count part of the text (illustration).

Use a cell as the criterion

To compare with a number stored in a cell, join the operator and the cell reference with an ampersand. If D1 holds 100:

=COUNTIF(B2:B10, ">" & D1)

Now you can change D1 and the count updates.

Count cells that contain some text

Wildcards help when you only know part of the text. An asterisk stands for any number of characters, and a question mark stands for exactly one:

=COUNTIF(A2:A10, "*shipping*")

This counts every cell that has the word shipping anywhere in it. To count cells that start with INV, use "INV*".

Count blank and non-blank cells

  • =COUNTIF(A2:A10, "") counts empty cells.
  • =COUNTIF(A2:A10, "<>") counts cells that are not empty.
Count between two values in Google Sheets with COUNTIFS
Two conditions on one range (illustration).

Count between two values

COUNTIF takes one condition, so for a range such as 50 to 100 subtract two counts:

=COUNTIF(B2:B10, ">=50") - COUNTIF(B2:B10, ">100")

A shorter way is COUNTIFS, which accepts several conditions at once:

=COUNTIFS(B2:B10, ">=50", B2:B10, "<=100")

COUNTIFS in Google Sheets with several conditions
Paid orders in one region (illustration).

COUNTIF with several conditions

When the conditions are on different columns, use COUNTIFS. To count Paid orders from the North region:

=COUNTIFS(A2:A10, "Paid", C2:C10, "North")

The Excel version works the same way, and our guide to COUNTIFS with multiple criteria covers more patterns.

Count by date

Dates are numbers, so the same operators work. To count dates after the first of November 2026:

=COUNTIF(E2:E10, ">" & DATE(2026,11,1))

Highlight what you count

If you want to see the matching cells and not only count them, use a rule instead. Read conditional formatting in Google Sheets for the steps.

Common COUNTIF mistakes

  • Numbers stored as text. A count of zero often means the values are text. Convert them first.
  • Missing quotes. Operators and wildcards must sit inside quotation marks.
  • Extra spaces. "Paid " with a trailing space does not match "Paid".
  • Mismatched ranges. In COUNTIFS every range must have the same size.

Questions and answers

What is the difference between COUNTIF and COUNTIFS?

COUNTIF tests one condition on one range. COUNTIFS tests several conditions and counts a row only when all of them are true.

Can COUNTIF count values that match any one of two options?

Yes. Add two COUNTIF formulas, for example one for "Paid" and one for "Pending". Do this only when the two sets cannot overlap, or you will count a row twice.

Is COUNTIF case sensitive?

No. For a case sensitive count, use SUMPRODUCT with the EXACT function.

How do I count unique values?

Use COUNTUNIQUE. See the UNIQUE function guide.

Summary

Start with COUNTIF for one condition, add operators and wildcards when the match is not exact, and move to COUNTIFS as soon as you need a second condition.

العربية