# The COUNTIF Function in Excel

Last Updated on 04/05/2024

The COUNTIF function counts the number of rows based on a single criterion.

1. The column containing the criterion

Select the column where is the criterion to select

2. The criterion

Value of the criterion or reference of a cell

=COUNTIF(Range of cells, criteria of selection)

## Don't use the filters

Most of the Excel users, use the filter to count the rows. But this solution is really not efficient when you have to do this, again and again, for many values.

The solution is to use the COUNTIF function or the COUNTIFS function

## How to use COUNTIF

In the following document, you have a list of sales.

You want to know how many times you have sold Banana. To return the number of times you have the name Banana in your list, you have to write the formula like this

=COUNTIF(B3:B12,"Banana")

## Replace the criteria with a cell reference.

Now, if instead of typing the name of the data, you want to have the reference of a cell where its value = the name you want. For instance, you can use cell G4.

=COUNTIF(B3:B12,G4)

## Not sensitive case

Don't worry if your criterion doesn't have the same case of the data in your table, the COUNTIF function of Excel, is not a sensitive case. For instance, in this example, we want to count the number of times we have the word PEACH in uppercase and the result is

## More than one criteria

If you need to count rows with more than one criterion, you must use the function COUNTIFS. It isn't more complex but you just have to write more arguments 😉

## Frédéric LE GUEN

1. dr.strange
06/03/2018 @ 04:28

i was expecting a quiz

2. Jean
09/01/2018 @ 19:15

I really appreciate your practice exercises, they have been very helpful. I teach seniors how to use both Word/Excel and you exercises have been good.

Jean Brown
Dr. Piper Center

Jean

• Frédéric LE GUEN
09/01/2018 @ 19:27

Thanks

# The COUNTIF Function in Excel

Last Updated on 04/05/2024

The COUNTIF function counts the number of rows based on a single criterion.

1. The column containing the criterion

Select the column where is the criterion to select

2. The criterion

Value of the criterion or reference of a cell

=COUNTIF(Range of cells, criteria of selection)

## Don't use the filters

Most of the Excel users, use the filter to count the rows. But this solution is really not efficient when you have to do this, again and again, for many values.

The solution is to use the COUNTIF function or the COUNTIFS function

## How to use COUNTIF

In the following document, you have a list of sales.

You want to know how many times you have sold Banana. To return the number of times you have the name Banana in your list, you have to write the formula like this

=COUNTIF(B3:B12,"Banana")

## Replace the criteria with a cell reference.

Now, if instead of typing the name of the data, you want to have the reference of a cell where its value = the name you want. For instance, you can use cell G4.

=COUNTIF(B3:B12,G4)

## Not sensitive case

Don't worry if your criterion doesn't have the same case of the data in your table, the COUNTIF function of Excel, is not a sensitive case. For instance, in this example, we want to count the number of times we have the word PEACH in uppercase and the result is

## More than one criteria

If you need to count rows with more than one criterion, you must use the function COUNTIFS. It isn't more complex but you just have to write more arguments 😉

1. dr.strange
06/03/2018 @ 04:28

i was expecting a quiz

2. Jean
09/01/2018 @ 19:15

I really appreciate your practice exercises, they have been very helpful. I teach seniors how to use both Word/Excel and you exercises have been good.

Jean Brown
Dr. Piper Center

Jean

• Frédéric LE GUEN
09/01/2018 @ 19:27

Thanks