Count() Function




The Excel COUNT function returns the count of values that are numbers, generally cells that contain numbers. Values can be supplied as constants, cell references, or ranges.


Syntax

The syntax for the COUNT function in Microsoft Excel is:
=COUNT( argument1, [argument2, ... argument_n] )

argument1, argument2, ... argument_n

Either ranges of cells or values. There can be up to 30 arguments.

Count Function Examples

Example 1 - Values Supplied from a Range of Worksheet Cells

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:


A
B
C
1
5
0
=COUNT( A1:A5 )
2
text

=COUNT( A1:A5, B1 )
3
FALSE

=COUNT( A1:B5 )
4
01/01/2015


5
#N/A
10


Results:


A
B
C
1
5
0
2
2
text

3
3
FALSE

4
4
01/01/2015


5
#N/A
10


Note that, in the above example:

·         The numbers and the date 01/01/2015 are counted by the function.
·         The text value "text", the logical value FALSE, and the error value #N/A are not counted by the function.
·         The empty cells are not counted by the function.

Example 2 - Values Supplied Directly to the Excel Count Function

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:


A
1
=COUNT( 100, DATE(2015,1,1) )
2
=COUNT( "100", "01/01/2015", FALSE )
3
=COUNT( "text", #N/A )

Results:


A
1
2
2
3
3
0

Note, in the above example:

·         The number 100 and the date 01/01/2015 are counted by the function.
·         The text representations of the number "100" & the date, "01/01/2015", and the logical value FALSE, are counted by the function.
·         The text string "text" and the error #N/A are not counted by the function.

Notes

·         Count can handle up to 255 additional values.
·         Error values or text values that cannot be coerced into numbers are not counted
·         The logical values TRUE and FALSE are not counted.
·         Empty cells and text are not counted.
·         Use COUNTA to include text and logical values. Use COUNTIF to count based on criteria.

No comments:

Post a Comment

OR Function