COUNTIF Function in Excel: A Must-Know Function

Reading time: 2 minutes

The COUNTIF function is one of the top 10 Excel functions every user should know. It helps count cells that meet a specific condition in your workbook. This makes it a powerful tool for analyzing data.

Don’t use Filter to Count Rows ⛔

Using the Filter tool to count rows can be time-consuming, especially with large datasets. Because

  1. You must filter your dataset on a specific column
  2. Select your value in the filter dropdown list
  3. Visualize in the status bar the number of records
  4. Remember this number in your head because once you select a new item, this value will disappear 🤯
Filter and count the rows in the status bar

The solution: The COUNTIF function 😃👍

The COUNTIF function does the same job

  • The function counts all the rows on a specific criterion.
  • A criterion is the value you select in the dropdown list in the filter
  • But with the COUNTIF formula, you have the result immediately
  • This saves time and reduces errors 🏆

How to use the COUNTIF function?

The function is very simple to use

  1. Range: The cells to check.
  2. Criteria: The condition to match.

=COUNTIF(range, criteria)

Now, if we want to count how many rows correspond to “Jeans” we have to write the following formula

How many times we have sold Jeans with the COUNTIF function

But we can also replace the name “Jeans” by the value in cell F4.

COUNTIF function with a cell reference as criterion

How to Count with Multiple Criteria?

You cannot use COUNTIF for multiple criteria. Instead, use the COUNTIFS function.

  • It counts rows that match more than one condition.
  • You can use up to 256 criteria.
  • For most tasks, 3-5 criteria are usually enough.

Practice with exercises

Practice the COUNTIF function directly in the grid below.

countif customers quiz48

COUNTIF Exercise - First steps: count with text, a number or a blank cell

Count how many clients match a single condition (status, children, email) in a client file using COUNTIF — 6 guided steps, no fill-down.

=COUNTIF( range , "criteria" )

1 / 6

You have a file of 15 clients with their name, email, marital status, number of children and income.
In G2, count the clients whose status is "Married". Type the criteria in full inside the formula.

COUNTIF Clients — Q1 · 371

=COUNTIF( range , criteria_cell )

2 / 6

In G2, count the single clients. Cell G1 holds the criteria "Single" — use that cell reference in your formula.

COUNTIF Clients — Q2 · 372

=COUNTIF( range , value )

3 / 6

In G2, count the clients who have exactly 2 children.

COUNTIF Clients — Q3 · 373

=COUNTIF( range , value )

4 / 6

In G2, count the clients who have no children (0 child).

COUNTIF Clients — Q4 · 374

=COUNTIF( range , "" )

5 / 6

In G2, count the clients who have no email address. An empty cell is tested with the criteria "" (two double quotes).

COUNTIF Clients — Q5 · 375

=COUNTIF( range , criteria_cell )

6 / 6

In G2, count the divorced clients. Cell G1 holds the criteria — use that cell reference.

COUNTIF Clients — Q6 · 376

Your score is

0%

Related articles

Practice this function

Reading is a good start, but practice is how you remember. These exercises are based on real questions from Excel forums, with instant correction.

Leave a Reply

Your email address will not be published. Required fields are marked *

COUNTIF Function in Excel: A Must-Know Function

Reading time: 2 minutes

The COUNTIF function is one of the top 10 Excel functions every user should know. It helps count cells that meet a specific condition in your workbook. This makes it a powerful tool for analyzing data.

Don’t use Filter to Count Rows ⛔

Using the Filter tool to count rows can be time-consuming, especially with large datasets. Because

  1. You must filter your dataset on a specific column
  2. Select your value in the filter dropdown list
  3. Visualize in the status bar the number of records
  4. Remember this number in your head because once you select a new item, this value will disappear 🤯
Filter and count the rows in the status bar

The solution: The COUNTIF function 😃👍

The COUNTIF function does the same job

  • The function counts all the rows on a specific criterion.
  • A criterion is the value you select in the dropdown list in the filter
  • But with the COUNTIF formula, you have the result immediately
  • This saves time and reduces errors 🏆

How to use the COUNTIF function?

The function is very simple to use

  1. Range: The cells to check.
  2. Criteria: The condition to match.

=COUNTIF(range, criteria)

Now, if we want to count how many rows correspond to “Jeans” we have to write the following formula

How many times we have sold Jeans with the COUNTIF function

But we can also replace the name “Jeans” by the value in cell F4.

COUNTIF function with a cell reference as criterion

How to Count with Multiple Criteria?

You cannot use COUNTIF for multiple criteria. Instead, use the COUNTIFS function.

  • It counts rows that match more than one condition.
  • You can use up to 256 criteria.
  • For most tasks, 3-5 criteria are usually enough.

Practice with exercises

Practice the COUNTIF function directly in the grid below.

countif customers quiz48

COUNTIF Exercise - First steps: count with text, a number or a blank cell

Count how many clients match a single condition (status, children, email) in a client file using COUNTIF — 6 guided steps, no fill-down.

=COUNTIF( range , "criteria" )

1 / 6

You have a file of 15 clients with their name, email, marital status, number of children and income.
In G2, count the clients whose status is "Married". Type the criteria in full inside the formula.

COUNTIF Clients — Q1 · 371

=COUNTIF( range , criteria_cell )

2 / 6

In G2, count the single clients. Cell G1 holds the criteria "Single" — use that cell reference in your formula.

COUNTIF Clients — Q2 · 372

=COUNTIF( range , value )

3 / 6

In G2, count the clients who have exactly 2 children.

COUNTIF Clients — Q3 · 373

=COUNTIF( range , value )

4 / 6

In G2, count the clients who have no children (0 child).

COUNTIF Clients — Q4 · 374

=COUNTIF( range , "" )

5 / 6

In G2, count the clients who have no email address. An empty cell is tested with the criteria "" (two double quotes).

COUNTIF Clients — Q5 · 375

=COUNTIF( range , criteria_cell )

6 / 6

In G2, count the divorced clients. Cell G1 holds the criteria — use that cell reference.

COUNTIF Clients — Q6 · 376

Your score is

0%

Related articles

Practice this function

Reading is a good start, but practice is how you remember. These exercises are based on real questions from Excel forums, with instant correction.

Leave a Reply

Your email address will not be published. Required fields are marked *