HomeFree lessonsPremiumAbout
← All free Excel lessons

COUNTIF in Excel

Count rows matching a condition. Learn the concept, work through a practical example, and check your answer.

What does COUNTIF do?

COUNTIF has two arguments: the range to inspect and the criteria to match. Text criteria belong in quotes.

Workplace example

Department names appear in B2:B30. Count how many employees work in Sales.

Example solution

=COUNTIF(B2:B30,"Sales")

Try the practice question before looking at the solution again. In Excel, formula arguments are separated by commas in many regional settings; your Excel installation may use semicolons.

Practice exercise

Department names appear in B2:B30. Count how many employees work in Sales.

Take it further

Try changing Sales to Finance.

Common mistake: Check that your ranges cover the correct rows and that text criteria are enclosed in quotation marks when required. When copying formulas, pay attention to relative versus absolute references.

Explore another free exercise →