The COUNTIF function counts how many cells in a range match a single condition. This guide explains how COUNTIF works and includes practical examples you can use immediately.

WHAT THE COUNTIF FUNCTION DOES

COUNTIF tallies cells that meet one specific criterion, such as counting how many sales are above a threshold, how many orders came from a specific region, or how many entries match a text pattern. It's useful for quick data summaries without needing helper columns.

If you need multiple conditions, use COUNTIFS.

WHEN TO USE COUNTIF

Use COUNTIF when you want to:

  • Count how many cells match one condition
  • Get quick summaries of your data
  • Filter and count without extra steps or helper columns
FORMULA SYNTAX
COUNTIF(range, criteria)
ArgumentDescription
rangeThe group of cells to check
criteriaThe condition to apply, like "West" or ">100"
EXAMPLE 1: COUNT ORDERS FROM THE WEST REGION

We want to count how many orders came from the West.

AB
1RegionProduct
2WestA
3EastB
4WestA
5WestB
=COUNTIF(A2:A5, "West")

Result: 3 (rows 2, 4, and 5)

Need help applying this? Try this in Numstro Builder

EXAMPLE 2: COUNT ORDERS GREATER THAN $100

We want to count how many orders are greater than $100.

AB
1CustomerAmount
2Alice120
3Bob90
4Carol180
5David60
=COUNTIF(B2:B5, ">100")

Result: 2 (rows 2 and 4)

Need help applying this? Try this in Numstro Builder

COMMON MISTAKES & EDGE CASES
  • Text and logical operators must be in quotes — e.g. ">100", "West"
  • Use "<>" to count non-blank or "not equal" values
  • Wildcards are supported: "*" for any characters, "?" for one character
  • Only one condition allowed — use COUNTIFS if you need more
RELATED FUNCTIONS
  • COUNTIFS — multiple condition version
  • SUMIF — sum with one condition
  • AVERAGEIF — average with one condition
FURTHER READING

Official Microsoft documentation:
COUNTIF — Microsoft Support