Quick answer
Use =COUNTIF(B2:B7,"Pending") to count Pending statuses, for a result of 3.
Formula syntax
The syntax is =COUNTIF(range, criteria). Each part tells Excel what to check and what to return.
range- The cells Excel checks, such as the Status values in B2:B7.
criteria- The condition to match, such as the text "Pending" or a comparison like ">=10".
Worked example
This example counts how many rows have a Pending status.
| Task | Status |
|---|---|
| Order 1 | Pending |
| Order 2 | Done |
| Order 3 | Pending |
| Order 4 | Done |
| Order 5 | Pending |
| Order 6 | Done |
Formula: =COUNTIF(B2:B7,"Pending")
Result: There are 3 cells with the status Pending.
How to type it in Excel
- Enter the headings "Task" and "Status" in A1:B1, then enter the six rows shown above in A2:B7.
- Select an empty cell for the count, such as D2.
- Type =COUNTIF(B2:B7,"Pending").
- Press Enter. Excel counts the matching status cells and returns 3.
Common mistakes
- For text criteria, include double quotes. Use "Pending", not Pending.
- Select only the status cells you want to count. COUNTIF uses one range and does not take a separate sum_range.
- Check for extra spaces in source cells. "Pending " may not match "Pending".
- Text matching is not case-sensitive. Use * for any number of characters or ? for one character, such as "Pend*".
Frequently asked questions
What does COUNTIF return?
COUNTIF returns the number of cells in one range that meet the condition.
Can COUNTIF count text?
Yes. COUNTIF can count text values, numbers, and cells that meet comparison conditions.
Can COUNTIF match part of a word?
Yes. Use a wildcard such as "*Pend*" to count cells containing that text.