Excel Counta Function

Excel COUNT & COUNTA Functions

The Excel Count and Counta functions both count the number of values within a supplied set of values or range of cells.

The two functions differ in the following ways:

  • The Count function returns the count of numeric values (includes numbers and dates);
  • The Counta function returns the count of all non-blank values (includes numbers, dates, text values, logical values and errors).
Related Functions:
COUNT
COUNTBLANK

Function Description

The Excel Counta function returns the number of non-blanks within a supplied set of cells or values.

The syntax of the function is:

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

Where the arguments, value1, [value2], etc., can be values, arrays of values, or references to cell ranges.

In recent versions of Excel (2007 and later), you can enter up to 255 value arguments to the Excel Counta function, each of which may consist of any number of cells or values. However, in Excel 2003 and earlier, the function can only handle up to 30 arguments.

Note that, if a cell contains an empty text string or a formula that returns an empty text string, this cell is counted as a non-blank by the Counta function.


Counta Function Examples

Example 1 - Values Supplied from a Range of Worksheet Cells

Column C of the following spreadsheet shows examples of the Counta function, used to return the number of non-blank cells in one or more supplied cell ranges.

 Formulas:
  A B C
1 1   =COUNTA( A1:A6 )
2 2 TRUE =COUNTA( A1:A6, B1:B2 )
3 #N/A    
4      
5      
6 text    
 Results:
  A B C
1 1   4
2 2 TRUE 5
3 #N/A    
4      
5      
6 text    

Example 2 - Values Supplied Directly to the Excel Counta Function

In the following spreadsheet, the Excel Counta function is used to return the number of non-blank values within a set of values that is supplied directly to the function.

 Formula:
  A
1 =COUNTA( "text", 1, 2 )
2  
 Result:
  A
1 3
2  

For further examples of the Excel Counta function, see the Microsoft Office website.