ExcelFluent
Start free

How to use COUNTIF and COUNTIFS in Excel

COUNTIF counts the cells that meet a condition: how many orders a rep made, how many invoices are over a limit. COUNTIFS counts rows that meet several conditions at once.

Syntax

=COUNTIF(range, criteria)
=COUNTIFS(range1, criteria1, range2, criteria2, ...)
range
The cells to check.
criteria
The condition, in quotes for text and comparisons: "Ashley", ">1000".

Try it now · free, no sign-up

Count orders

  1. In G2, count how many orders Ashley made.
  2. In G3, count the orders over $1,000.
  3. In G4, count orders that are in the East and for a Laptop.
ABCDEFG
1RepRegionProductAmountQuestionCount
2AshleyWestLaptop1,200.00Ashley's orders
3BrianEastMonitor300.00Orders over $1,000
4AshleyEastLaptop1,150.00East laptops
5DanielSouthKeyboard80.00
6BrianWestLaptop1,300.00
7DanielEastMonitor320.00
8AshleyWestKeyboard75.00
9BrianSouthLaptop1,250.00

Loading the live spreadsheet…

Common conditions

"<>" counts cells that are not empty; "" counts empty ones. "*north*" counts cells containing "north" anywhere. ">="&F2 compares with the value in F2.

COUNT, COUNTA and COUNTIF

COUNT counts numbers, COUNTA counts anything that is not empty, and COUNTIF counts what matches a condition. Interview tests often mix these up on purpose.

Common mistakes

Comparison without quotes
=COUNTIF(D2:D9,>1000) is an error. Write ">1000".
Counting with OR
COUNTIFS joins conditions with AND. For "East or West", add two COUNTIFs together.

Practice it until it sticks

ExcelFluent has 42 hands-on lessons, from SUM to XLOOKUP, plus 5 real work projects and a final challenge that uses everything. Every answer is checked instantly. The first 5 lessons and 1 work project (an invoice with tax) are free.

Start the free lessons → Open the full COUNTIF & COUNTIFS lesson

Frequently asked questions

Is COUNTIF case sensitive?

No. "ashley" and "Ashley" are counted the same.

How do I count unique values?

In Microsoft 365, =COUNTA(UNIQUE(A2:A9)).

Related practice