Function COUNTIF

A basic task with Excel is to count the number of rows for a specific criteria.

Solution with the filter

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.

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

COUNTIFIn 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 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 B3 where its value is CD-Rom

=COUNTIF(B3:B12,B3)

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 😉

Permanent link to this article: https://www.excel-exercise.com/countif/


3 comments

    • dr.strange on 06/03/2018 at 04:28
    • Reply

    i was expecting a quiz

    • Jean on 09/01/2018 at 19:15
    • Reply

    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

    1. Thanks
      And share the links of the website during your training

Leave a Reply

Your email address will not be published.