Google Sheets function
COUNTIF function in Google Sheets
COUNTIF in Google Sheets counts cells in one range that match a single criterion. The criterion can check text, a number, a comparison such as greater than, or a pattern with wildcards. Use COUNTIF to count statuses, thresholds, names, or other repeated conditions.
Source: Google Docs Editors HelpLast verified Nov 5, 2026
Syntax
=COUNTIF(range, criterion)Arguments
| Argument | Required | What it means |
|---|---|---|
range | Yes | The range tested against the criterion. |
criterion | Yes | The pattern or test applied to each cell in the range. |
Examples
Count completed tasks
| A | B | |
|---|---|---|
| 1 | Task | Status |
| 2 | Draft | Done |
| 3 | Review | Waiting |
| 4 | Publish | Done |
=COUNTIF(B2:B4,"Done")Result: 2
Two cells in the status range exactly match Done.
Common mistakes
Leaving a text criterion outside quotation marks.
Write text criteria as strings, such as "Done".
Trying to test several criteria with COUNTIF.
COUNTIF handles one criterion. Use COUNTIFS for multiple criteria.