Statistics formula
COUNTIF in Excel and Google Sheets
Count cells that meet a single condition.
Syntax
=COUNTIF(range, criteria)- range
- The cells to count.
- criteria
- The condition.
Example
| Row | A | B |
|---|---|---|
| 1 | Task | Done |
| 2 | Plan | Yes |
| 3 | Build | No |
| 4 | Test | Yes |
| 5 | ||
| 6 | Done tasks |
B6 =COUNTIF(B2:B4,"Yes")
Result: 2
Counts how many cells in B2:B4 say Yes.
Ready-to-copy formulas
Find duplicates
=COUNTIF(A:A,A2)>1Count cells above a value
=COUNTIF(B:B,">100")
Tips
- Great for spotting duplicates with conditional formatting.
Need the whole spreadsheet?
Start from a free template with every formula already in place. Opening a template uses no credits.