Beginner Condition

Function COUNTIF

Reading Time: 2 minutes

A basic task with Excel is to count the number of rows for a specific criteria. The function COUNTIF do that easily 😃

Don't use the filters

Most of the Excel users, use the filter to count the rows.

But this solution is really not convenient when you have to repeat this action for many values.

Filter header

The solution is to use COUNTIF or COUNTIFS

Presentation of COUNTIF

The function COUNTIF counts the number of rows for one criteria.

The function requires only two arguments

  • The range of cells where is your data
  • The value you search (the criterion).

=COUNTIF(Range of cells, criteria of selection)

Example with COUNTIF

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

COUNTIF

You want to know how many times you have sold Banana.

To return the number of time you have the name Banana in your list, you have to write the formula like this

=COUNTIF(B3:B12,"Banana")

And the result is

Replace the criteria by 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 the cell G4 where its value is Banana

=COUNTIF(B3:B12,G4)

Not sensitive case

Don't worry if your criteria hasn't the same case of the data in your table, the function COUNTIF, is not 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 criteria you must use function COUNTIFS

It isn't more complex but you just have to write more arguments 😉

Related posts

Remove spaces in Excel with TRIM

Frédéric LE GUEN

3D Function

Frédéric LE GUEN

Fill Series

Frédéric LE GUEN

3 comments

dr.strange 06/03/2018 at 04:28

i was expecting a quiz

Reply
Jean 09/01/2018 at 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

Reply
Frédéric LE GUEN 09/01/2018 at 19:27

Thanks
And share the links of the website during your training

Reply

Leave a Comment