ID EN
#Statistical

COUNTA

Excel Functions

Count the number of non-blank cells

Syntax

EXCEL
=COUNTA(value1, [value2], ...)

Arguments

Parameter Description
value1 An item, cell reference, or range.
value2 [optional] An item, cell reference, or range.

Return Value

A number representing non-blank cells.

Details

The COUNTA function counts cells that contain values, including numbers, text, logicals, errors, and empty text (""). COUNTA does not count empty cells. The COUNTA function returns the count of values in the list of supplied arguments. COUNTA takes multiple arguments in the form value1, value2, value3, etc. Arguments can be individual hardcoded values, cell references, or ranges up to a total of 255 arguments. All values are counted, including text, numbers, percentages, errors, dates, times, fractions, and formulas that return empty strings (""). Empty cells are ignored. In the example shown, COUNTA is set up to values in the range B5:B15: COUNTA returns 9, since there are 9 non-empty cells in the range B5:B15. The COUNTA function counts numbers and text:

Examples

Examples

In the example shown, COUNTA is set up to values in the range B5:B15:

EXCEL
=COUNTA(B5:B15) // returns 9
Examples

The COUNTA function counts numbers and text:

EXCEL
=COUNTA(1,2,3) // returns 3
=COUNTA(1,"a","b") // returns 3
=COUNTA(1,2,3,"a",5%) // returns 5
Examples

To count non-empty cells in the range A1:A10:

EXCEL
=COUNTA(A1:A10) // count non-empty cells in A1:A10
Examples

To count non-empty cells in the range A1:A10 and the range C1:H2:

EXCEL
=COUNTA(A1:A10,C1:H2) // two ranges
Empty strings

Note that COUNTA includes empty strings ("") in the count, which can be returned by formulas. For example, the formula below will return "OK" when the

EXCEL
=IF(A1>=10,"OK","")

See Also

COUNT COUNTA COUNTIF COUNTIFS COUNTBLANK