Learn how to use Countif function in Excel


COUNTIF function counts cell meeting a single criterion. It will Count the Empty or the Blank Cells present in the Range. You can use COUNTIF to count or Calculate the number of Cells, the cells with dates, numbers, and text matching a specific criterion. The COUNTIF function Supports the logical operators (>, <, <>, =) also with wildcards (*,? i.e the asterisk and the question mark). The Wildcards help in partial matching.

Countif function will help you to know how many records of a certain type you have in your Excel spreadsheet.

The Excel Countif function returns the number of cells within a supplied range, that satisfy given criteria.

When to use Countif Function?

COUNTIF function can be used when you want to count the number of cells that meet specified criteria.

What does it return?

It returns a value(number) that represents the number of cells that meet specified criteria in the selected range.


To Count the cells matching your criteria

Return the value

A number representing cells counted.


COUNTIF(range, criteria)

range – Defines one or several cells to count. You put the range in a formula like you usually do in Excel, e.g. A1:A20.

criteria – Defines the condition that tells the function which cells to count. It can be a number, text string, cell reference or expression. For instance, you can use the criteria like these: “10”, A2, “>=10”, “some text”.

Case Study: Let’s analyze result grade sheet of students in which we want to find out how many students have got GPA 4. We can find this using Countif Function.

Steps to Follow Using Countif Function:-

countif function in excel

Step 1: Create a table similar to the picture above.


Step 2: In the Cell E2 we will calculate the number of students who have got GPA 4. type this formula in cell E2:



Step 3: Now press ENTER, you will get the value 3 which is a number of students who got GPA 4.

Tip 1:


In the Criteria portion of the formula, You can use also B3 to get the same result. Because cell B3 contains the value GPA 4. So, in that case formula would be:


Tip 2:


Imagine that you want to find the number students who got GPA more than 3, then the formula would be:

=COUNTIF(B2:B9, “>3”)

So, we can also give mathematical condition in criteria.

Read More: Learn Text To Column in Excel with Example

Tip 3: If you want to find those students whose name contains Roy, then use this formula and see the magic:

=COUNTIF(A2:A9, “*Roy”)

We use * before Roy that means find those values who has Roy at the end. By giving * means whatever exists before Roy it will count that.

Tip 4: We can also Sum 2 Countif results in another cell. Think you want to sum these 2 Countif result of =COUNTIF(B2:B9,B3) and COUNTIF(B2:B9, “>3”). To do so, you can use this formula given below:

=COUNTIF(B2:B9,B3)+COUNTIF(B2:B9, “>3”)

Excel COUNTIF Text

Supposing you have the same data as above, and you want to count the number of cells which contain the text ‘Roni Roy’.

Excel COUNTIF Text function will help to count the number of specific text or part of text cells.

  1. Select a blank cell. Let’s say cell E2 (in our Case) and enter the formula

=COUNTIF(A2:A9,”*Roni Roy*”) into the Cell.

  1. Now Press Enter
  2. You’ll get the answer as 1

COUNTIF greater than, less than or equal to

To count the no. of cells with values that are greater than or less than or equal to the specified number. Here, what you have to do is: Add a corresponding operator to the criteria that are shown in the table below.

Let’s check out an example of Excel Count if Greater than:

You can count the number of cells greater than or less than zero using this Formula:

In the given example shown above:

Steps for COUNTIF greater than, less than or equal to:

  • Select a Blank Cell, let’s say cell E2 (in our Case)
  • Enter formula =COUNTIF (B2:B9,”>0″) into the Formula Bar
  • Press Enter
  • The Selected Blank cell will populate the number of Cells Greater than 0. In our Case, we get the value as 8

Therefore, the Excel COUNTIF greater than 0 is value 8.

Excel COUNTA function non Blank Cells:

The Excel COUNTA function helps in returning the number of Cells that are non-Blank with the help of the Excel Counta Function. It helps in obtaining the Count of cells which contain text, empty text (“”), error values, logical values and numbers. Excel Count if not blank does not count empty cells. The Excel COUNTBLANK function returns a count of empty cells in a specific range.

Steps for Excel COUNTA Function non Blank Cells:

  • Select a Blank Cell, let’s say cell E2 (in our Case)
  • Enter formula =COUNTA(B2:B9) into the Formula Bar
  • Press Enter
  • The Selected Blank cell will populate Excel Count of Cells if not blank. In our Case, we get the value as 6

Excel COUNTBLANK Function:

The Excel COUNT BLANK will Count the Empty or the Blank Cells present in the Range. These Cells might contain errors, text and numbers etc. which are not considered. It only has the Formula which returns the empty text in Count.

If there are Blank Cells in your Dataset, you need to Count cells that are blank. If you need to count the cells that are Blank, you need to use the COUNTBLANK function.  You

COUNTIF function google sheets:

The COUNTIF function in google sheets is a combination of IF function and the COUNT function in Google Sheets. With this Combination, you’ll be able to make a Count of numbers, text or values found in a selected range of Cells meeting a specified or a Single Criterion.

1 Response
  1. sweetie

    Would like to know the difference between all count function Together. CountIF, CountA CountSum, Count and others.

Leave a Reply

Pre-Registration Open

Power BI Dax

Related Tutorials

Text To Column in Excel | Split Cells
January 4, 2019
Pivot Tables (Complete Guidelines)
December 27, 2018
Power Bi Dax Deduplication Based On Column
December 17, 2018
Special Character Symbol List with Shortcodes in Excel
December 15, 2018
December 10, 2018
December 10, 2018
How to use ABS Function in Excel
December 10, 2018
How to use AND Function in Excel
December 10, 2018
Delete Duplicate in Excel or Remove Duplicate in Excel
November 9, 2018
Excel Formulas PDF
September 6, 2018
How To Lock Cells in Excel | Unprotect Excel
August 13, 2018
4x Faster at Excel
August 6, 2018
Separate Content of One Excel Cells into Separate Columns
August 3, 2018
How to Transpose Excel Columns to Rows | Paste Special Method
July 26, 2018
How to create sparklines in Excel
July 19, 2018
AutoSum in Excel with Shortcut
July 17, 2018
OFFSET Function in Excel
July 6, 2018
Strikethrough Shortcut in Excel & Word
July 4, 2018
INDIRECT Function with SUM, MAX, MIN & Independent Cell Value
June 29, 2018
Pivot Table Slicers In Excel
June 12, 2018
How to Wrap Text in Excel Automatically and Manually
June 6, 2018
How to Hide/Unhide Column in Excel
June 5, 2018
Highlight row based on cell value
June 4, 2018
Learn how to remove blank cells in Excel
June 3, 2018
How to Group Numbers, Dates & Text in Pivot table in Excel
June 1, 2018