COUNTIF
Count only the cells that match a condition: text, numbers, wildcards and more. Intermediate · 5 min · COUNTIF, Criteria, Wildcards
COUNTIF counts the cells in a range that meet one condition:
=COUNTIF(range, criteria)
The criteria can be:
- text, such as
"Email"(capital letters don't matter) - a comparison, such as
">=30" - a pattern:
*matches any run of characters and?matches exactly one "<>Closed", meaning anything except Closed
> Comparisons go inside the quotes: ">=30", not >=30.
Steps
How many support tickets came in by email? In
H2, count theEmailentries in the channel columnB2:B11.Customers who wait 30 minutes or more tend to complain. In
H3, count the tickets inD2:D11with a wait of 30 or more.Every billing topic starts with "Billing". In
H4, count them inC2:C11with a wildcard:"Billing*"matches Billing followed by anything.In
H5, count the tickets inE2:E11that are not Closed, whether they are Open or Pending.The team's wait limit lives in
H8. InH6, count the waits longer than that limit. Join the operator to the cell with&:">"&H8.
Remember
=COUNTIF(range, criteria)counts the matching cells.- Put comparisons inside the quotes:
">=30","<>Closed". *and?are wildcards for partial text matches.">"&H8builds the criteria from a cell.
Previous: IFERROR and IFNA · Next: SUMIF and AVERAGEIF