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
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.
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
Ranges of different sizes
Every criteria range must cover the same rows, or COUNTIFS returns #VALUE!.
Expecting OR logic
COUNTIFS joins conditions with AND. For OR, add two COUNTIFS together.
FAQ
- Is there a limit on conditions?
- Up to 127 range/condition pairs.