FormulaCamp
Completed
← Google Sheets functions
Google Sheets function

COUNTIF in Google Sheets

COUNTUNIQUE is a Google Sheets function with no Excel counterpart of the same name, and it counts distinct values in one step.

Syntax (same in Google Sheets)

COUNTIF(range, criteria)

COUNTIF counts matches against a criterion rather than distinct entries.

For a fuller explanation of the arguments and common errors, see the COUNTIF Excel guide.

Worked examples in Google Sheets

Count by category

ABC
1RegionRepAmount
2EastAna1200
3WestBen850
4EastCara430
5NorthDan970
6WestEli1500
7EastAna610

Formula: E2: =COUNTIF(A2:A7,"East")

Result: 3

Three rows have East in the Region column.

Count by threshold

ABC
1RegionRepAmount
2EastAna1200
3WestBen850
4EastCara430
5NorthDan970
6WestEli1500
7EastAna610

Formula: E2: =COUNTIF(C2:C7,">=1000")

Result: 2

Counts amounts of 1000 or more: 1200 and 1500.

Wildcard count

ABC
1RegionRepAmount
2EastAna1200
3WestBen850
4EastCara430
5NorthDan970
6WestEli1500
7EastAna610

Formula: E2: =COUNTIF(B2:B7,"A*")

Result: 2

Counts names that start with A. Ana appears twice.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in F2: =COUNTIF(C2:C7,">50")

Example spreadsheet for COUNTIF
ABCDEF
1RegionProductUnitsPriceResult
2EastPen1202.53
3WestPen802.5
4EastBook4512
5NorthBook6012
6WestLamp3025
7EastLamp1525
Result in F2: 3
Practice this in a lesson: COUNTIF and SUMIF

Frequently asked questions

How do I count distinct values in Google Sheets?
Use COUNTUNIQUE(range). COUNTIF is for counting the cells that meet a condition.

Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.