COUNTIF: how many tickets are open?

Lesson 14 of 54

COUNTIF counts how many cells in a range meet one condition, like how many orders are "Late" or how many scores are above 80. It works the same in Excel and Google Sheets.

In cell D2, write a formula that counts how many tickets have the Status "Open".

D2
ABCD
1TicketStatusOpen tickets
2T-101Open
3T-102Closed
4T-103Open
5T-104Pending
6T-105Open
7T-106Closed

Type in the formula bar above and press Enter to check.

Skip

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.