Learn how to use Countif function in Excel

Summary

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.

Purpose

To Count the cells matching your criteria

Return the value

A number representing cells counted.

Syntax

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.

enter-countif-formula

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

=COUNTIF(B2:B9,4)

result-for-countif-function

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

Tip 1:

countif-range

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:

=COUNTIF(B2:B9,B3)

Tip 2:

result-for-countif

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

Related Tutorials

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 Split Cells in Excel using Text to Column
June 7, 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
5 Powerful Tricks to Format cells in Excel
May 31, 2018
Insert a Picture into a Cell in Excel
May 25, 2018
What is ISFORMULA Function and FORMULATEXT Function
May 21, 2018
How to Use SUBSTITUTE Function
May 21, 2018
Excel Quartile Function in Excel
May 8, 2018
How to use the Excel PERCENTILE function
May 7, 2018
Insert or Type degree symbol in Excel with Autocorrect Feature
May 7, 2018
25% Discount
No prize
All Courses at $200
Almost!
10% Discount
Free Ebook
No Prize
No luck today
Almost!
50% Discount
No prize
80% Discount
Get a chance to boost your knowledge!
Use this coupon code for any course that you wish for. 
Our in-house rules:
  • You can choose any course & redeem coupon
  • If you find any difficulty, mail us on [email protected]
  • Wheel Spin will end soon
  • Coupon code can be applied within 2 days.