The COUNTIF function in Excel is used to count the number of cells that meet a condition (criteria).
COUNTIF Syntax:
=COUNTIF(range, criteria)
For example:
Count how many times "Apple" appears If A1:A16 contains {Apple, Orange, Banana, Peach}:
1. Click on an empty cell
For example, click on B1 (this is where the result will show).
Empty Cell
2. Type the formula
Formula
- Select or type range A1:A16
Range of Cells
- Type "Apple" and a closing parenthesis),→ the condition (what you want to count).
Closing Parenthesis
-
3. Press Enter. Excel will calculate.
Calculate