The Excel Count and the Excel 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 Excel Count function returns the count of numeric values in a supplied set of cells or values. This count includes both numbers and dates.
The syntax of the function is:
Where the arguments, value1, [value2], etc., can be any 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 Count function, each of which may be single values or arrays of cells or values. However, in Excel 2003, the function can only handle up to 30 value arguments.
Numbers and dates are always counted as numeric values by the Excel Count function. However, text representations and logical values are counted differently, depending on whether they are supplied as a value in a range of cells, or if they are supplied directly to the function.
The table below summarises which values are and which are not treated as numeric values by the Excel Count function:
Value Within a Range of Cells |
Value Supplied Directly to Function |
|
---|---|---|
Numbers | ARE counted | ARE counted |
Dates | ARE counted | ARE counted |
Logical Values | NOT counted | ARE counted |
Text Representations of Numbers & Dates |
NOT counted | ARE counted |
Other Text | NOT counted | NOT counted |
Errors | NOT counted | NOT counted |
Column C of the following spreadsheet shows three examples of the Count function, used to return the number of numeric values in one or more supplied ranges of cells.
Formulas:
|
Results:
|
Note that, in the above example:
In the following spreadsheet, the Excel Count function is used to count the number of numeric values in sets of values supplied directly to the function.
Formulas:
|
Results:
|
Note, in the above example:
For further examples of the Excel Count function, see the Microsoft Office website.