Skip to content

Excel function guide · Conditional sums & counts

COUNTIFS function in Excel

COUNTIFS counts the rows that meet every condition you give it, such as tickets that are open and belong to the Tech team. Each condition is a pair: a range to test and the criterion to test it against.

Syntax

=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], …)
ArgumentRequired?What it means
criteria_range1RequiredThe first range to test.
criteria1RequiredIts condition: a value, a cell, a comparison in quotes (">5") or a wildcard pattern.
criteria_range2, criteria2, …OptionalMore pairs, all the same size as the first range. A row counts only if it meets them all.

COUNTIFS examples

Every example uses this small table. The results are what Excel shows in the cell.

ABCD
1TeamPriorityStatusDays open
2BillingHighOpen3
3TechHighClosed1
4TechLowOpen9
5BillingLowOpen12
6TechHighOpen6
7BillingHighClosed2
  1. 1. Two text conditions

    =COUNTIFS(A2:A7, "Tech", C2:C7, "Open")

    Result: 2

    Tech tickets that are still open: rows 4 and 6.

  2. 2. Not equal to

    =COUNTIFS(B2:B7, "High", C2:C7, "<>Closed")

    Result: 2

    "<>Closed" counts every status except Closed.

  3. 3. Between two numbers

    =COUNTIFS(D2:D7, ">=3", D2:D7, "<=9")

    Result: 3

    Use the same range twice for a lower and an upper limit: 3, 9 and 6 days.

Try it now

Practise COUNTIFS in a live sheet.

Type each formula yourself. Answers are checked by the same engine as the full course. No account needed.

Try it · COUNTIFS
0 XP
F3
A
B
C
D
E
F
1
Team
Priority
Status
Days open
Question
Answer
2
Billing
High
Open
3
Team
Billing
3
Tech
High
Closed
1
Open, team F2
4
Tech
Low
Open
9
Open > 5 days
5
Billing
Low
Open
12
Both, team F2
6
Tech
High
Open
6
7
Billing
High
Closed
2
8
Double-click or start typing to edit

Step 1 of 3

In F3, count the Open tickets for the team in F2.

Common COUNTIFS mistakes

Practise this in Excel Quest

SUMIFS & COUNTIFS Members

Course 5 · Conditional Aggregation · 12 min

Answer business questions that need two, three or a date range of conditions at once.

This lesson is included in Formula Quest memberships. A free account starts you on the free lessons of the Excel Quest curriculum.

Related functions

All Excel function guides