Excel function

COUNTIFSfunction

Counts the rows that meet all of several conditions.

All versions
=COUNTIFS(A2:A9, "Busan", C2:C9, ">=15")
Range to drag
A
B
C
D
1
2
3
4
5
6
7
8
9

Drag the corner dots to change criteria_range1, criteria_range2. Click a cell in the criteria range to use its value as the criteria. Change criteria1 to "<>Daegu" to count rows outside Daegu with a quantity of 15 or more. Try breaking it on purpose to see the errors.

Result

2

criteria_range1
A2:A9Drag a corner dot up/down to resize, sideways to change the column

The column checked by the first condition.

criteria1

The first condition.

criteria_range2
C2:C9

The column checked by the second condition.

criteria2

The second condition.

What is the COUNTIFS function?

=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)

COUNTIFS counts the rows where every condition is TRUE. Each condition checks its own range, and all ranges must be the same size.

Use it for questions like "how many Busan orders had a quantity of 15 or more?"

Arguments

criteria_range1
The cells checked by criteria1.
criteria1
The condition. Type a value such as "Seoul", a comparison such as ">=20" or "<>Seoul", or a wildcard pattern such as "B*" (* for any characters, ? for one character). Text and comparisons go in double quotes.
criteria_range2, criteria2
More range/condition pairs. Up to 127 pairs are allowed.

COUNTIFS examples

  1. Example 1. Busan orders with quantity 15 or more

    =COUNTIFS(A2:A9, "Busan", C2:C9, ">=15")

    Busan has quantities 12, 15 and 25. Two of them are 15 or more, so the result is 2.

  2. Example 2. Values in a band

    =COUNTIFS(C2:C9, ">=10", C2:C9, "<20")

    Use the same range twice to count values from 10 up to (but not including) 20.

Common mistakes

FAQ

Is there a limit on conditions?
Up to 127 range/condition pairs.