Using the COUNT, COUNTA, and COUNTBLANK functions to count cells in Excel
When working with Excel, you often need to count cells that contain values or empty cells. Excel provides several functions to count cells based on your specific needs. The following article will guide you on how to use the COUNT, COUNTA, and COUNTBLANK functions to count cells in Excel.
1. Using the COUNT function to count cells with numbers
The COUNT function counts the number of cells that contain numbers.
Function syntax: =COUNT(value1, [value2], …)
Where:
- value1: Required, the cells or ranges in which you want to count cells.
- value2, …: Optional, up to 255 arguments, additional cells or ranges in which you want to count cells.
Note:
- The arguments can contain or reference different data types, but only numbers will be counted.
- Numbers, dates, or text representations of numbers (e.g., numbers enclosed in quotation marks, such as “1”) will be counted.
- Logical values and text representations of numbers entered directly into the list of arguments will be counted.
- Text or error values that cannot be converted to numbers will not be counted.
- If an argument is an array or reference, only the numbers in that array or reference will be counted. Blank cells, logical values, text, or error values within the array or reference will not be counted.
Example: Let’s say we have a list of math test scores as shown in the table below. We want to count the number of students who have scores.
We can use the following formula to count the number of students with scores: =COUNT(C2:C9)
We can see that there are 6 students with scores. Trung is absent and does not have a score, so he is not counted.
Example 2: Let’s say we have two tables of math test scores. We want to count the total number of students who have scores in both tables.
In this case, we can use the following formula to count the total number of students with scores in both tables: =COUNT(C2:C9, G2:G9)
2. Using the COUNTA function to count cells with any type of data
The COUNTA function counts cells that contain any type of information, including error values and empty text (“”). For example, if a range contains a formula that returns an empty string, the COUNTA function will count that value. The COUNTA function does not count blank cells.
Function syntax: =COUNTA(value1, [value2], …)
Where:
- value1: Required, the cells or ranges in which you want to count cells.
- value2, …: Optional, up to 255 arguments, additional cells or ranges in which you want to count cells.
Using the same example as above, if we use the COUNTA function, we will get the following result:
We can see that the result is 7 instead of 6 as in the COUNT function. In this case, Trung’s test score cell is also counted because it contains a text value.
3. Using the COUNTBLANK function to count empty cells
The COUNTBLANK function is used to count the number of empty cells in a range.
Function syntax: =COUNTBLANK(range)
Where: Range is the range of cells you want to count blank cells.
Note: The number 0 is not considered blank.
Example: Continuing with the previous example, let’s count the number of students who do not have scores.
Thus, the above article has guided you on how to use the COUNT, COUNTA, and COUNTBLANK functions to count cells in Excel. Good luck!