Which function counts only numbers in a range?

A lot of people know they can use COUNT to count cells in Microsoft Excel. But there are actually 4 different COUNT functions available, and you might not know their subtle differences. We are going to cover them in detail in this short tutorial.

The COUNT Function

Let's start with the most basic function: COUNT. It's important to know that it only counts cells containing numbers. All other cells will be ignored (texts, dates, blanks).

=COUNT(range)

Here's how it works with a simple example.

Which function counts only numbers in a range?

There are 5 numbers in the range, and the result is 5. As expected!

The COUNTA Function

If you want to count cells with any type of data (and not just numbers), simply replace COUNT by COUNTA. This will count all cells that are not blank (numbers, texts, dates).

Which function counts only numbers in a range?

There are 5 numbers and 2 texts, 5+2 = 7.

The COUNTBLANK Function

What if you want to do the opposite: only count the blank cells? Then you should use COUNTBLANK.

Which function counts only numbers in a range?

There are 2 blank cells, so the result is correct.

The COUNTIF Function

For more advanced ways to count, you'll have to use COUNTIF. This is basically a combination between the 2 functions COUNT and IF.

=COUNTIF(range, condition)

It will count the cells in the range only if they meet the condition.

For our example, if you want to count only the values that are higher than 30, use this:

=COUNTIF(B2:D4, ">30")

You have to put quotes above the condition, otherwise it won't work.

Which function counts only numbers in a range?

There are only 3 cells above 30, and the result is 3. So It seems to be working :-)

Bonus

What if you want to count every cell in a range? Both the ones with content and the ones that are empty? For this to work you have to use 2 functions at the same time:

=COUNTA(range) + COUNTBLANK(range)

There's no built in function to do this, so that's the only solution.

Conclusion

You can see that for something as simple as "count the number of cells in a range", you have lots of options to choose from. So make sure you understand the differences between all these functions:

In the above formula COUNT function counts number of cells contain only number within the range B5:B11 named as TestData.

Count number of cells that does not contain numbers

Which function counts only numbers in a range?

Syntax of used function(s)

SUMPRODUCT(array1, [array2], [array3], ...)
ISNUMBER(value)

The SUMPRODUCT function is used to multiplies the corresponding components in the given arrays, and returns the sum of those products.
The ISNUMBER funtion returns True if the value refers to a number.

Formula


=SUMPRODUCT(--NOT(ISNUMBER(TestData)))

How the formula works

In the above formula the ISNUMBER function search number in the range named as TestData and returns True or False.

While working with Excel, we are able to determine the number of values that fall within a specified range by using the COUNTIFS function. The COUNTIFS function counts the number of cells that meet one or more criteria.  This step by step tutorial will assist all levels of Excel users in counting numbers by range with COUNTIFS.  

Which function counts only numbers in a range?
Figure 1. Final result: Count cells by range using COUNTIFS

Final formula: =COUNTIFS(C3:C9,">=70",C3:C9,"<=79")

Syntax of COUNTIFS Function

=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2]…)

Parameters:

  • Criteria_range1: the data range that will be evaluated using the criteria1
  • Criteria1:  the criteria or condition that determines which cells will be counted
  • Criteria_range2 and criteria2 are optional; only applied when there are more than one criteria as specified

Setting up Our Data

Our table contains a list of Personnel ID (column B) and Performance Rating (column C).  Cells E3:E5 contains our criteria which classifies the Performance Rating into three ranges: 70-79, 80-89 and 90-99.  The resulting count per range will be reflected in cells F3:F5.

Which function counts only numbers in a range?
Figure 2. Sample data to count numbers by range using COUNTIFS

Count Numbers by Range using COUNTIFS

We want to count the performance ratings per specified range.  

Count Ratings Between 70 and 79

To count the number of ratings between the range of 70 to 79, we follow these steps:

Step 1.  Select cell F3

Step 2.  Enter the formula: =COUNTIFS(C3:C9,">=70",C3:C9,"<=79")

Step 3: Press ENTER

The range for our data set is C3:C9.  Our formula has two criteria.  It counts the cells in column C  with values between 70 and 79. The symbol “>=” means “greater than or equal to” while “<=” means “less than or equal to”.  

Which function counts only numbers in a range?
Figure 3. Using the COUNTIFS function to count numbers between the range 70 and 79

The formula returns the value 1, which means that there is only one value between 70 and 79 in our data.  

 Count Ratings Between 80 and 89

To count the number of ratings between the range of 80 to 89, we follow these steps:

Step 1.  Select cell F4

Step 2.  Enter the formula: =COUNTIFS(C3:C9,">=80",C3:C9,"<=89")

Step 3: Press ENTER

The procedure is the same as in our previous example.  Only this time, the criteria is different because the lowest value is 80, and the highest value is 89.  Our formula counts the cells in column C  with values between 80 and 89.

The formula returns the value 4, which means that there are four values between 80 and 89, as highlighted below.  

Which function counts only numbers in a range?
Figure 4. Using the COUNTIFS function to count numbers between 80 and 89

Count Ratings Between 90 and 99

To count the number of ratings between the range of 90 to 99, we follow the same procedure but entering this formula in cell F5:

=COUNTIFS(C3:C9,">=90",C3:C9,"<=99")

The only difference is the specified criteria, which is between the range of 90 and 99.  Our formula returns the value 2, for the ratings 93 and 97 as highlighted below.

Which function counts only numbers in a range?
Figure 5. Using the COUNTIFS function to count numbers between 90 and 99

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Which of the following functions only counts numbers in a range?

The correct answer is COUNT IF. COUNT IF function in MS-Excel counts the number of cells within a range that meet the given condition.

Which function will only count how many cells in a selected range have numbers in them?

Use COUNTIF, one of the statistical functions, to count the number of cells that meet a criterion; for example, to count the number of times a particular city appears in a customer list. In its simplest form, COUNTIF says: =COUNTIF(Where do you want to look?, What do you want to look for?)