Statistics formula

COUNTIF in Excel and Google Sheets

Count cells that meet a single condition.

Syntax

=COUNTIF(range, criteria)
range
The cells to count.
criteria
The condition.

Example

COUNTIF example
RowAB
1TaskDone
2PlanYes
3BuildNo
4TestYes
5
6Done tasks

B6 =COUNTIF(B2:B4,"Yes")

Result: 2

Counts how many cells in B2:B4 say Yes.

Ready-to-copy formulas

  • Find duplicates

    =COUNTIF(A:A,A2)>1
  • Count cells above a value

    =COUNTIF(B:B,">100")

Tips

  • Great for spotting duplicates with conditional formatting.

Need the whole spreadsheet?

Start from a free template with every formula already in place. Opening a template uses no credits.