Function reference /Math & aggregation

COUNTIF

Run in a real sheet

Counts how many cells in a range meet a condition.

COUNTIF(range, criterion)

COUNTIF answers "how many?" — how many orders from this region, how many entries over budget, how many times a name appears. Counting duplicates is its most common job.

Executed 23 Aug 2026 Google Sheets · unedited screenshot
=COUNTIF(A2:A6, "West") running in Google Sheets, returning 2
The formula sits in the formula bar and its answer sits in the grid, in one frame. Two rows have West as their region.

Worked example

RegionRepSales
WestAna1200
EastBen900
WestCara1500
NorthDan600
EastEve1100
=COUNTIF(A2:A6, "West")

Returns 2.

Arguments

ArgumentRequiredWhat it does
range Yes The cells to test.
criterion Yes A value, or a comparison in quotes such as ">1000".

Gotchas

  • 01COUNTIF is not case sensitive — "west" and "West" count as the same thing.
  • 02* and ? are treated as wildcards. To count a literal asterisk, escape it as ~*.
  • 03It counts cells, not distinct values. For distinct values use COUNTA(UNIQUE(range)).