How COUNTIF works
Syntax
=COUNTIF(range, criterion)range- The cells to check.
criterion- What to count: "Late", ">80", "<>"&E1, "*@gmail.com", or a cell like E2.
Example
Customer emails are in B2:B500. You want to know how many are Gmail addresses.
=COUNTIF(B2:B500, "*@gmail.com")Counts every email that ends in @gmail.com. The * matches any text in front.
Common mistakes
- Comparisons without quotes. Write ">80", not >80, and ">"&E1 to compare with a cell.
- Expecting case-sensitive matching. COUNTIF treats "late" and "LATE" the same.
- Extra spaces in the data. "Late " with a trailing space doesn't match "Late". Clean it with TRIM.
Questions people ask
How do I count with two conditions?
Use COUNTIFS: =COUNTIFS(A2:A100,"North",C2:C100,">100") counts rows that meet both.
How do I count cells that are not blank?
Use =COUNTIF(A2:A100,"<>") or simply =COUNTA(A2:A100).
Practice it above: type the formula in the formula bar and press Enter to check.