Which function is used to count the number of cells within a range of cells?

Excel is a widely used data management tool that helps us analyze and interpret data. It is underappreciated for the wide variety of tasks that can be performed on the application. Excel has a versatile library of built-functions, making it a very powerful tool. Hence making it a popular one too. 

In this article, we will be discussing the function COUNT in Excel.

As the name suggests, the ‘COUNT’ function helps us count cells in Excel. But that’s not it! There are five variations of COUNT in Excel, which helps us perform numerous counting tasks that we will be exploring in this article.

What is COUNT in Excel?

The COUNT function is generally used to count the number of cells in Excel or array of numbers.

Example: To count the numbers between A1 and A20, you may enter the following formula: =COUNT(A1:A20). For example, if the range contains three cells containing numbers, the result is 3.

There are two different ways to use COUNT in Excel. The syntax is as follows:

COUNT(value1,[value2],…)  

The parameters of the COUNT function include comma-separated values. This function returns the total count of numeric values specified.

Usage:

Which function is used to count the number of cells within a range of cells?

Here we specify multiple values as the parameter and the COUNT function finds the total count of values in it.

NOTE: This function works only on numeric data. Hence, it will not find the count of text values if specified.

COUNT(range) 

This function is used to count the number of cells in a specified range. It can be used to quantify data.  

Which function is used to count the number of cells within a range of cells?

As we can see, using =COUNT(A2: A6), we get the count of cells in the range A2 to A6. This function works only on numeric data.

Now that we have understood how to use the function COUNT in Excel let’s look at the next function - COUNTA. 

PCP in Business Analysis

In partnership with Purdue UniversityVIEW COURSE

Which function is used to count the number of cells within a range of cells?

What Does the Function COUNTA Do in Excel?

This function counts cells with data, i.e., non-empty values within a range. The syntax is as follows:

=COUNTA(value1,[value2],…)

The values can be any range too. For example A1:A10

Usage:

Which function is used to count the number of cells within a range of cells?

As shown above, =COUNTA(E2: E6) counts cells with data(non-empty cells) in the range E2 to E6.

What Is the Difference Between COUNT and COUNTA in Excel?

COUNT calculates the count of cells with numeric values. In comparison, COUNTA finds the count of cells with non-empty data.

How Do You Use COUNTBLANK?

As the name implies, COUNTBLANK is a simple function that counts the number of blank or empty cells. The syntax is as follows:

=COUNTBLANK(range)

The COUNTBLANK function works on a specified range as a parameter.

Usage:

Which function is used to count the number of cells within a range of cells?

Looking at the example shown, COUNTBLANK helps count cells that are left blank/empty. We can use this function to find the entries that are left blank.

How Do You Use COUNTIF?

The COUNTIF function counts cells that match specific criteria. The syntax is as follows:

 =COUNTIF(range,criteria) 

The two arguments here are:

  • Range- which can be specified as a range of cells in Excel. For example B1: B6
  • Criteria- a condition on the function. For example: “>50”, A1

This function works on the specified range, counting the cells that match the criteria or condition. 

Usage:

  • COUNTIF can be used to match the criterion with a string.

For example: 

Which function is used to count the number of cells within a range of cells?

We are using the formula =COUNTIF(C2: C6, “Tianjin”) to check how many locations match the city “Tianjin”.

  • COUNTIF can be used to count cells with text-

Counting cells that only contain text is simple. We use ‘*’ as the condition.

The ‘*’ or asterisk symbol helps find any number of characters. In the following demo, you will see how the wildcard ‘*’ matches any number of characters.

Which function is used to count the number of cells within a range of cells?

The function =COUNTIF(D2: E12,”*”) executes over the range D2 to E12 and counts cells that contain text.

If you want a partial match, you can use wildcard characters to count cells that contain a particular word or letters. Look at the example below:

Which function is used to count the number of cells within a range of cells?

The formula =COUNTIF(C2: C12, “*HUBEI*”) counts the cells that have the value “HUBEI” in the range C2 to C12.

NOTE: Here, the asterisk symbol helps find cells with any sequence of leading or trailing characters. Also, this does not apply to boolean values.

  • COUNTIF can be used to count cells with the help of logical operators: Greater than, equal to or less than.

For example: 

Which function is used to count the number of cells within a range of cells?

=COUNTIF(E2:E6,">=60")

Here, we have used the COUNTIF function to find the number of people over the age of 60 affected by COVID. We have taken the range of ages from cells E2 to E6. The criteria being that the value must be greater than or equal to 60.

NOTE: The criteria MUST be specified within quotes.

Similarly, you can use the following logical operations.

Logical operation

Formula Example

Description

Less than “<”

=COUNTIF(C1:C10,”<20”)

Count if the values in cells are lesser than 20

Less than or equal to “<=”

=COUNTIF(C1:C10,”<=20”)

Count if the values in cells are lesser than or equal to 20

Greater than “>”

=COUNTIF(C1:C10,”>20”)

Count if the values in cells are greater than 20

Greater than or equal to “>=”

=COUNTIF(C1:C10,”>=20”)

Count if the values in cells are greater than or equal to 20

Equal to “=”

=COUNTIF(C1:C10,”=20”)

Count if the values in cells are equal to 20

Not equal to “!=”

=COUNTIF(C1:C10,”<>20”)

Count if the values in cells are not equal to 20

Free Course: Introduction to MS Excel

Master the Fundamentals of MS ExcelEnroll Now

Which function is used to count the number of cells within a range of cells?

How Do You Use COUNTIFS?

This function is a plural counterpart of the COUNTIF function. It calculates the count of cells upon meeting multiple criteria.

The syntax is as follows:

  • =COUNTIFS(range1, criteria1,[range2, criteria2]…)

Here, range1 maps to the criteria1, range2 maps to criteria2, and so on.

The range1 and criteria1 are required arguments while the rest in square brackets are optional.

  • Range1 will be the range of cells to which the first condition (criteria1) will be applied.
  • Criteria1 defines the condition for the function that will work on Range1. The criteria can be any number, string, expression, or it can also be a cell reference. For example, “>=20”, ”China” or A1.
  • Similarly, [range2, criteria2] defines another set of range and its respective criteria to be met. They follow an ‘AND’ logic.

Multiple range-criteria sets can be added, and they must be comma-separated.

We will demonstrate the usage as follows.

Which function is used to count the number of cells within a range of cells?

The formula =COUNTIFS(B2:B12,">2/1/2020",D2:D12,"France") is used on two criteria. It checks if the reporting date is after 2/1/2020 AND if the country of the deceased individual is France.

NOTE: The COUNTIFS function follows AND logic. It counts cells only if both or ALL conditions are true. 

More About COUNTIF

There are various numbers of tasks that can be performed using COUNTIF and COUNTIFS.

  • If you have to find the number of times a value occurs in a range:

You can use =COUNTIF(A1: A10, A1). This will be demonstrated below.

Which function is used to count the number of cells within a range of cells?

Using =COUNTIF(F2: F12, F2), we find the total count of cells where the cell containing “male” gender has been repeated.

  • Let’s say we want to find out if the data contains unique entries or not.

We can do so by using an IF with COUNTIF. Look at the following example.

Which function is used to count the number of cells within a range of cells?

The COUNTIF function executes first and finds the count of cells within the range A2 to A12, where the value in cell A3 (which is 2) has appeared. If the count is more than 1, duplicate values exist, and the result will be displayed as “DUPLICATE”. Else it displays “UNIQUE”. 

Gain expertise in the latest Business analytics tools and techniques with the Business Analyst Master's Program. Enroll now!

Conclusion

We hope this article has given you a strong understanding of how various functions are used to COUNT in Excel. The function may seem to perform simple calculations. But when you combine them with other Excel functions, you will be amazed by how powerful Excel is in getting meaning out of massive datasets.

Do you have any questions related to this article? If so, please mention it in the comments section and our experts will get back to you at the earliest. 

You can also go the extra mile and enhance your Excel skills by enrolling in the Business Analytics with Excel Free Course offered by Simplilearn.

About the Author

Which function is used to count the number of cells within a range of cells?
Shruti M

Shruti is an engineer and a technophile. She works on several trending technologies. Her hobbies include reading, dancing and learning new languages. Currently, she is learning the Japanese language.

How can you count the number of cells of this range?

Ways to count cells in a range of data.
Select the cell where you want the result to appear..
On the Formulas tab, click More Functions, point to Statistical, and then click one of the following functions: COUNTA: To count cells that are not empty. ... .
Select the range of cells that you want, and then press RETURN..

Which function is used if you want to count the number of cells within a range that meets the given condition?

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.

What is the use of Counta () and Countblank () function in an Excel give a suitable example?

COUNTA counts how many populated cells in a range (i.e. not blank). COUNTBLANK counts how many blank cells in a range. COUNTIF counts how many cells in a range meet a certain condition.

Which function in Excel is used to count the number of cells in a range that are not empty?

Use the COUNTA function to count only cells in a range that contain values.