EXCEL SOLUTIONS

COUNTIF function in Excel

Counts the cells that meet one condition, such as equal to a word or bigger than a number.

BeginnerCounting

Syntax

=COUNTIF(range, criteria)
Arguments of COUNTIF
ArgumentWhat it means
rangeThe cells to look at.
criteriaThe condition: a word like "Pen", a number, or an operator with a number like ">10". Use * as a wildcard: "N*" matches anything starting with N.

Examples with results

Every result below is calculated by the practice engine on the sample data shown, not typed in by hand.

Office supplies sales (fictional)

RowABCDE
1ItemQtyUnit priceRegionDate
2Pen101.5North2025-01-15
3Notebook512South2025-02-03
4Pen201.5South2025-02-28
5Stapler240North2025-03-10
6Folder153.25East2025-03-22
7Notebook812East2025-04-05
8Pen121.5North2025-04-18
9Marker302South2025-05-02
Office supplies sales (fictional) Row 1 holds the headings. All data is fictional. Dates are year-month-day.

Download CSV

  • =COUNTIF(A2:A9,"Pen")3

    How many Pen orders

  • =COUNTIF(B2:B9,">10")4

    Orders of more than 10 units

  • =COUNTIF(D2:D9,"N*")3

    Regions starting with N

Try it yourself

Change the formula or switch to other sample data.

Press Calculate to see the result.

The practice box runs in your browser with BDK’s own calculator, which covers about 60 common functions. Cell references work as in Excel (B2, B2:B9). Your formulas are not saved or sent anywhere. For anything unusual, check the result in Excel itself.

How people use COUNTIF at work

  • HR

    How many people work in Sales.

    =COUNTIF(B2:B8,"Sales")2
    Data: Team list (fictional)
  • Operations

    How many products hold fewer than 10 units?

    =COUNTIF(C2:C6,"<10")2
    Data: Stock levels (fictional)

Common mistakes and tips

  • Put operators in quotes with the number: ">10", not >10.
  • COUNTIF is not case sensitive: "pen" and "Pen" match.
  • Use COUNTIFS when you have more than one condition.

Works in

All versions of Excel, and Google Sheets.

Related formulas

COUNTIFSSUMIFCOUNTA

Lessons that use it

Tools that help

Need Something Different? Let’s Talk.

Looking for different features or something built around your workflow? Share your idea with us.