FormulaCamp
Completed
← All functions
Statistics

COUNTIF

Counts cells that meet a condition.

Syntax

COUNTIF(range, criteria)

Example: =COUNTIF(B2:B10,">100")

Available in: All versions

COUNTIF counts the cells in a range that meet one condition: =COUNTIF(range, criteria). Use it to count how many orders came from a region, how many scores pass, or how many times a name appears.

When to use it

Arguments explained

Worked examples

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

Common errors and how to fix them

Related functions

Frequently asked questions

How do I count cells that are not empty?
Use =COUNTIF(A2:A100,"<>") or COUNTA.
How do I count duplicates?
Add a helper column =COUNTIF($A$2:$A$100,A2) and filter for values greater than 1.
Can COUNTIF count with OR?
Add two COUNTIFs, or use SUM(COUNTIF(A:A,{"East","West"})).
Is COUNTIF case sensitive?
No.

More in Statistics