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.
- 7 cách viết số mũ trong Excel vô cùng hữu ích mà bạn nên biết
- Hướng dẫn cố định dòng và cột nâng cao trong Excel, Cách Mới và Hiệu quả
- Hướng dẫn cách tạo, chèn bảng trong excel nhanh chóng
- Cách đánh số trang trong Excel 2003, 2007, 2010, 2016 chi tiết
- Hướng dẫn chèn file pdf vào trong excel 2010, 2013, 2016 đơn giản
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:
The parameters of the COUNT function include comma-separated values. This function returns the total count of numeric values specified.
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.
This function is used to count the number of cells in a specified range. It can be used to quantify data.
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.
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:
The values can be any range too. For example A1:A10
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:
The COUNTBLANK function works on a specified range as a parameter.
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:
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.
- COUNTIF can be used to match the criterion with a string.
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.
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:
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.
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.
Less than “<”
Count if the values in cells are lesser than 20
Less than or equal to “<=”
Count if the values in cells are lesser than or equal to 20
Greater than “>”
Count if the values in cells are greater than 20
Greater than or equal to “>=”
Count if the values in cells are greater than or equal to 20
Equal to “=”
Count if the values in cells are equal to 20
Not equal to “!=”
Count if the values in cells are not equal to 20
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.
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.
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.
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”.
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.