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.
Counts cells matching a condition.
COUNTIF(range, criteria)range
RequiredSpecify the range used for condition check or aggregation.
criteria
RequiredEnter the match condition, e.g. "Food", ">=80", "<>0".
Use COUNTIF to count rows where Category matches Food. You can set ranges by dragging from the start cell to the end cell in the same argument field.
| # | AProduct ID | BProduct Name | CCategory | DSales |
|---|---|---|---|---|
| 2 | P001 | Apple | Food | 1200 |
| 3 | P002 | Banana | Food | 980 |
| 4 | P003 | Notebook | Stationery | 450 |
| 5 | P004 | Pen | Stationery | 300 |
| 6 | P005 | Grapes | Food | 1500 |
| 7 | P006 | Ruler | Stationery | 250 |
| 8 | P007 | Peach | Food | 860 |
How to Use (Formula)
=COUNTIF(C2:C8, "Food")Result
4
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.
Use the "Start Function Practice" button to jump straight into COUNTIF drills.
The main arguments are Range, Criteria. Enter them in order.