ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 21 · Count functions

COUNTIFS in Excel

COUNTIFS counts rows that match two or more conditions at once. Each condition is a pair: where to look and what to look for. A row counts only if every pair matches.

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Count rows that match more than one condition

How it works

COUNTIFS(range1, what1, range2, what2). A row is counted only if it matches every pair.

Formulas at a glance

=COUNTIFS(B2:B9,6,C2:C9,"Art")grade 6 AND Art

Example

Write the formula to count 6th graders in the Art club.

ABCDE
1StudentGradeClub
2Ana6ArtGrade 6 Art
3Ben7ChessGrade 7 Chess
4Cleo6Music
5Dev7ArtGrade 6 Chess
6Eli6ArtGrade 7 Music
7Fay7Chess
8Gus6Chess

Click F2 and type =COUNTIFS(B2:B9,6,C2:C9,"Art"), then press Enter.

The answer is 2.

When to use it

  • How many 6th graders are in the Art club
  • How many East orders were shipped
  • Any count with an AND between the conditions

Common mistakes

  • Ranges of different sizesEvery range must cover the same rows, like B2:B9 and C2:C9.
  • Expecting ORCOUNTIFS means AND. For OR, add two COUNTIFS together.
  • Mixing up the order in a pairRange first, then what to look for.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

COUNTIFS in Excel: how it works, with examples · ExcelUnpack