Conditional function

Google Sheets COUNTIF function

Counts the cells in a range that meet one condition.

Syntax

=COUNTIF(range, criterion)
rangeThe cells to test.
criterionThe condition, such as "Pens", ">=100" or "A*".

Try it

Edit the formula and the result updates instantly. Click a cell to add its reference.

▦ Q1 sales
fx
Result: 3
ABCDE
1RepRegionProductUnitsRevenue
2AnaEastPens120240
3BenWestPaper80400
4CaraEastPaper45225
5DevNorthPens200400
6AnaEastInk30450
7BenWestPens95190
8CaraEastInk12180
9DevNorthPaper60300

Examples

These use the sample sheet above.

→ 3

How many sales were pens.

→ 4

Sales worth $300 or more.

→ 2

Wildcards: reps whose name starts with C.

Tips & common mistakes

Related functions