COUNTIFS: count with two conditions

Lesson 17 of 54

COUNTIFS counts the rows that meet several conditions at once, such as orders from one store that are over $100. Each condition is a pair: a range and what it must match.

In cell E2, write a formula that counts orders from "Online" with an Amount greater than 100.

E2
ABCDE
1OrderChannelAmountBig online orders
2#1Online250
3#2Store180
4#3Online60
5#4Online140
6#5Store90
7#6Online310

Type in the formula bar above and press Enter to check.

Skip

How COUNTIFS works

Syntax

=COUNTIFS(criteria_range1, criterion1, [criteria_range2, criterion2], ...)
criteria_range1
The first column to test.
criterion1
What it must match: "Open", ">100", "<>"&E1, or a cell.
criteria_range2, criterion2
Optional. More pairs; a row is counted only if it meets all of them.

Example

Support tickets have Priority in B2:B400 and Status in C2:C400. You want the high-priority tickets still open.

=COUNTIFS(B2:B400, "High", C2:C400, "Open")

Counts only the rows where both are true.

Common mistakes

  • Ranges of different sizes. Every range must cover the same rows.
  • Expecting "High" or "Urgent" to work in one criterion. COUNTIFS joins conditions with AND; for OR, add two COUNTIFS.
  • Comparisons without quotes: write ">100", and ">"&E1 for a cell.

Questions people ask

How do I count between two numbers?

Use the same range twice: =COUNTIFS(C:C, ">=100", C:C, "<=500").

What is the difference between COUNTIF and COUNTIFS?

COUNTIF takes one condition; COUNTIFS takes many. COUNTIFS with one pair does the same as COUNTIF.

Practice it above: type the formula in the formula bar and press Enter to check.