Counting cells that match a condition
=COUNTIF(range, criterion)
COUNTIF looks through a range and counts the cells that meet your criterion. The criterion is flexible:
| Criterion | Counts cells that… |
|---|---|
"West" | equal West (not case-sensitive) |
">500" | are greater than 500 |
"<>Done" | are anything except Done |
"*@gmail.com" | end with @gmail.com (* = any characters) |
"?????" | are exactly five characters (? = one character) |
E2 | equal whatever is in cell E2 |
Comparison criteria go inside the quotes: ">500", not >"500". To compare against a cell, join them: ">"&E2.