Count employees by department with COUNTIF

Beginner

When you have a list of records and want to know how many belong to each category, COUNTIF is the tool for the job. It counts how many cells in a range match a condition you specify, without requiring any sorting or filtering.

In this exercise, you have an employee roster in rows 2–10. Each row shows an employee's name, their department, and their start date. Below the roster is a summary table where you'll count the headcount for each department.

How COUNTIF works:

=COUNTIF(range, criteria)

  • range: the column to search through (the Department column)
  • criteria: the value to count (the department name)

What you need to do:

  1. Click cell B13 (next to "Sales").
  2. Type a COUNTIF formula that looks through the Department column (B2:B10) and counts how many cells match the label in A13.
  3. Press Enter.
  4. Copy the formula from B13 down to B14, B15, and B16.

When you're done, each row in the summary table should show the correct headcount for that department.

Need some help?

Hint 1

Rather than typing the department name in quotes (like "Sales"), point to the cell in column A instead. That way, the same formula automatically reads the right department when you copy it down to the rows below.

Hint 2

Lock the range with dollar signs ($B$2:$B$10) so it stays fixed when you copy the formula down to the other department rows.

Related function(s)