
Count how many cells match one condition. Useful for quick filtered counts like Yes/No, scores above a target, or text matches.
COUNTIF counts how many cells meet one condition. That condition can be a word, a number, a comparison like ">80", a wildcard match, or a cell reference.
This makes it a strong everyday function because you can turn a messy list into one clear tally. Instead of counting by hand, you give Excel one rule and let it do the matching for you.
Returns how many cells match a single rule.
Returns the number of cells that meet the condition. If nothing matches, the result is 0.
=COUNTIF(range, criteria)
range is where Excel looks, and criteria is what Excel tries to match.
| Function | What it does | Use it when |
|---|---|---|
COUNTIF |
Counts with one condition | You only need one rule |
COUNTIFS |
Counts with multiple conditions | You need more than one rule at the same time |
COUNT |
Counts numbers | You want all numeric entries with no condition |
COUNTA |
Counts non-empty cells | You want all filled cells with no condition |
COUNTIF is good for simple filtered questions. How many people answered Yes? How many scores are above 80? How many product names start with North? Those are all single-condition questions, which is exactly where COUNTIF fits best.
Microsoft notes that the criteria can be a number, expression, cell reference, or text string. That means values like 32, ">32", B4, and "apples" are all valid. Wildcards are supported too. The question mark ? matches one character, and the asterisk * matches any sequence of characters. If you need to match a real question mark or asterisk, put a tilde ~ in front of it.
Another practical detail is data quality. Microsoft points out that extra spaces and hidden characters can make text matches behave unexpectedly. If a COUNTIF result looks wrong, trimming or cleaning the source data is often the fix.
This is the standard COUNTIF pattern for words like Yes, No, Done, or Pending.
=COUNTIF(A1:A10,"Yes") // Counts how many cells contain Yes.
Count how many cells in A1:A10 have the word "Yes". Formula: =COUNTIF(A1:A10,"Yes").
Comparison operators turn COUNTIF into a quick threshold checker.
=COUNTIF(B1:B10,">80") // Counts how many values are greater than 80.
Count how many numbers in B1:B10 are greater than 80. Formula: =COUNTIF(B1:B10,">80").
The wildcard makes it possible to count several similar labels with one rule.
=COUNTIF(A1:A10,"North*") // Counts values that start with North.
Count every cell in A1:A10 that starts with "North". Formula: =COUNTIF(A1:A10,"North*").
This is useful in a reusable report because the tally can change when the criteria cell changes.
=COUNTIF(A1:A10,C1) // Uses the value in C1 as the condition.
Count how many times the value in C1 appears in A1:A10. Formula: =COUNTIF(A1:A10,C1).
? matches one character and * matches many.COUNTIFS when one condition is not enough.Tell your friends about this post