Excel Function

COUNTIF

Counts cells matching a condition.

COUNTIF(range, criteria)

Arguments

range

Required

Specify the range used for condition check or aggregation.

criteria

Required

Enter the match condition, e.g. "Food", ">=80", "<>0".

Practice Preview

Use COUNTIF to count rows where Category matches Food.

Example Table

#
AProduct ID
BProduct Name
CCategory
DSales
2P001AppleFood1200
3P002BananaFood980
4P003NotebookStationery450
5P004PenStationery300
6P005GrapesFood1500
7P006RulerStationery250
8P007PeachFood860

How to Use (Formula)

=COUNTIF(C2:C8, "Food")

Result

4

Practice This Function

COUNTIF FAQ

How do I use COUNTIF in Excel?

Use COUNTIF when you want to count rows or cells that match a condition. Enter Range, Criteria in that order, then add optional arguments when needed.

Where can I practice COUNTIF?

Use the "Start Function Practice" button to jump straight into COUNTIF drills.

What arguments does COUNTIF use?

The main arguments are Range, Criteria. Enter them in order.