TopicsCheat sheetLessons
Lurndo › Excel › COUNTIF

Learning Excel: COUNTIF

Counting what matches

Yasmina puts the week's sales slips on a pile. "How many pieces of clothing went out of the door?" Counting with a condition: that's what COUNTIF is for.

COUNTIF

COUNTIF counts the cells in a range that meet a condition. The first argument is the range, the second the condition: the criterion.

I2 holds =COUNTIF(B2:B16,"Clothing"): Clothing appears six times in the Category column. Upper or lower case doesn't matter.

I2
fx

=COUNTIF(B2:B16,"Clothing")

ABCDEFGHI
1ItemCategoryPriceDayVolunteerLimit
2Dress greenClothing£12.00MonSophie£10.006
3Book fictionBooks£2.00MonOmar
4LampHousehold£8.00TueSophie
5T-shirt SClothing£3.00TueGrace
6Dressing gownClothing£6.00WedOmar
7PuzzleToys£4.00WedGrace
8Book cookingBooks£3.00ThuSophie
9RadioElectrical£15.00ThuOmar
10T-shirt XLClothing£4.00FriSophie
11Dress blackClothing£18.00FriGrace
12What? GameToys£5.00SatOmar
13VaseHousehold£7.00SatGrace
14T-shirt MClothing£3.00SatSophie
15BookendHousehold£9.00SatOmar
16Kids' bikeToys£35.00SatGrace
17

Try it yourself

How many sales did Omar make? Count them in I2.

ABCDEFGHIJ
1ItemCategoryPriceDayVolunteerLimit
2Dress greenClothing£12.00MonSophie£10.00
3Book fictionBooks£2.00MonOmar
4LampHousehold£8.00TueSophie
5T-shirt SClothing£3.00TueGrace
6Dressing gownClothing£6.00WedOmar
7PuzzleToys£4.00WedGrace
8Book cookingBooks£3.00ThuSophie
9RadioElectrical£15.00ThuOmar
10T-shirt XLClothing£4.00FriSophie
11Dress blackClothing£18.00FriGrace
12What? GameToys£5.00SatOmar
13VaseHousehold£7.00SatGrace
14T-shirt MClothing£3.00SatSophie
15BookendHousehold£9.00SatOmar
16Kids' bikeToys£35.00SatGrace
17
I2

Ready for more?

The full lesson has 6 exercises, from easy to challenging, with hints, points and a streak you can build.

Start the lesson
← PreviousCatching error valuesNext →Criteria with operators

SQL

  • Topics
  • All lessons
  • Cheat sheet

Excel

  • Topics
  • All lessons
  • Shortcuts

HTML & CSS

  • About the course
  • All lessons

Lurndo

  • Dashboard
  • Leaderboard
  • Premium
  • Account
  • Privacy
Nederlands