COUNTIF and COUNTIFS in Excel: examples and practice

COUNTIF counts the cells in a range that meet one condition, and COUNTIFS counts with more conditions. For example, =COUNTIF(A2:A7,"North") counts the orders from the North region.

Syntax

=COUNTIF(range, criteria)
=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)
range / criteria_range1
The cells to test, for example the Region column.
criteria / criteria1
The condition: a value like "North", a comparison like ">100", or a cell.
criteria_range2, criteria2, ...
Optional in COUNTIFS. More pairs of range and condition. A row counts only when all conditions are met.

Examples

Example data

ABC
1RegionStatusAmount
2NorthPaid120
3SouthOpen80
4NorthOpen200
5EastPaid60
6NorthPaid90
7SouthPaid150
FormulaResultWhat it does
=COUNTIF(A2:A7,"North")3Counts the rows with North in the Region column.
=COUNTIF(C2:C7,">100")3Counts the amounts above 100. Put the comparison in quotes.
=COUNTIFS(A2:A7,"North",B2:B7,"Paid")2Counts the rows that are North and also Paid.

Try it

In cell E2, count the orders with the status Open.

Show the solution

=COUNTIF(B2:B7,"Open") → 2

Common mistakes

Comparison without quotes

=COUNTIF(C2:C7,>100) gives an error. Write ">100" in quotes. With a cell, join it: ">"&E2.

Ranges of different sizes in COUNTIFS

A2:A7 and B2:B6 do not match. COUNTIFS gives #VALUE!. All ranges need the same rows.

COUNT instead of COUNTIF

COUNT only counts cells with numbers. It has no condition. Use COUNTIF to count cells that meet a condition.

Fatima Haddad, owns Ridgeline Bike Rental

Practice this in a story

A short lesson from a real job. We show you each step, then you do it yourself.

How many e-bikes · Module 6 · Conditional Sums and Counts · 6 min

Fatima gives every bike a name. On Sunday, 16 rentals went out. Fatima wants to know which bike types are popular. You count them with COUNTIF.

Practice this in a story

More lessons with COUNTIF and COUNTIFS

Related functions