How to Use the COUNTA Function to Count Non-Blank Cells in Excel
In this tutorial, you'll learn how to use the Excel COUNTA function to count non-blank cells.
You want to count the number of cells that are not blank, including both numbers and strings. In such a case, you can use the COUNTA function. COUNTA is a function to count the number of cells that are not blank in a range of cells.
COUNTA Syntax
The syntax of the COUNTA() function is as follows:
=COUNTA(value1, [value2], [value3], ...)
Arguments
- value1: The first argument that you want to count
- value2: [Optional]. The second argument that you want to count.
- value3: [Optional]. The third argument that you want to count.
Remarks
- value1, value2,... can be a range of cells, a cell, or a value.
- You can specify up to 255 arguments.
- COUNTA counts cells that are not blank.
Excel COUNTA Examples
Demo data:
A | B | C | D | E | F | G | |
1 | Date | Code | Name | Qty | Price ($) | Amount ($) | Seller |
2 | 10/3/2019 | Item111 | HP Desktop PC | 3 | 225 | 675 | |
3 | 10/3/2019 | Item112 | Dell Desktop PC | 2 | 750 | 1500 | James |
4 | 10/4/2019 | Item113 | HP Laptop PC | 2 | 235 | 470 | John |
5 | 10/4/2019 | Item114 | Dell Laptop PC | 3 | 785 | 2355 |
Example 1
The following example counts the number of cells, which are not blank in cells D2 through G5:
=COUNTA(D2:G5)
The above formula returns 14.
Example 2
You can use COUNTA(), as the following example shows:
=COUNTA(D2:G5,200,C3,C5)
There are four arguments in the above formula.
The second argument is the number.
COUNTA counts the number of cells in D2 through G5, C3, C5, and 200. The formula returns 17.
Summary
In this tutorial, you've learned how to use the Excel COUNTA function. COUNTA is a function to count the number of non-blank cells in a range of cells. There are times when you want to count the number of cells that are not blank. In such a case, you can use the COUNTA function.
Use the COUNTBLANK function to count the number of blank cells.
Use the COUNTIF function to count the number of cells that match a condition.
Use the COUNTIFS function to count the number of cells that match multiple conditions.