Contents
ACCOUNT function in Excel counts the number of nonblank cells in the selected range, as well as the number of values in the argument list. For example, the following formula returns the number of cells in a range A1: B4, which contain at least some data.
Typically, the COUNTA function is used to count non-blank cells in Excel. However, with this function, you can also count the number of values in arrays whose data is not stored in cells.
Syntax of the COUNTA function
COUNTA(value1, [value2], …)
COUNTA(value1, [value2], …)
Any values, references to cells and ranges, data arrays, as well as formulas and functions can serve as arguments to the COUNTA function.
Meaning1 (value1) is a mandatory argument to the COUNTA function, all other arguments are optional and can be omitted.
Starting with Excel 2007, you can use up to 255 arguments, each capable of holding a huge amount of data. In earlier versions of Excel (such as Excel 2003), the COUNTA function only handled 30 arguments.
What data is taken into account by the COUNTA function
In Excel, the COUNTA function takes into account any type of data, including errors and empty text. For example:
- if a cell or COUNT function argument contains a formula that returns an empty string, they will be taken into account.
- if a cell, array or function argument contains the value #N/A (no data), they will also be taken into account.
The COUNTA function does not take into account only empty cells.
Helpful information
- To count the number of numeric values in a range of Excel data, use the COUNT function.
- If you want to count the number of empty cells, use the COUNTBLANKS function.
- To count the number of cells by condition, you can use the COUNTIF and COUNTIFS functions.
Examples of using the COUNTA function in Excel
- The following formula counts the number of nonblank cells in two ranges at once. In the example, you can see that the COUNTA function counts cells that contain booleans and errors.
- The following example shows that the COUNTA function takes into account cells that contain empty text.In this example, cell A1 contains a formula that returns an empty string.
- Imagine that we have an array of constants named “array” and 7×8 in size, i.e. 56 values.The COUNTA function allows you to count the number of values in a given array, no matter what type of data it contains.
- In this example, it can be seen that all the previously stated rules apply equally to the function arguments themselves, i.e. they are also included in the calculation.