Difference between revisions of "Documentation/How Tos/Calc: COUNT function"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
 
(12 intermediate revisions by 8 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{DISPLAYTITLE:COUNT function}}
 +
{{Documentation/CalcFunc StatisticalTOC
 +
|ShowPrevNext=block
 +
|PrevPage=Documentation/How_Tos/Calc:_AVERAGEA_function
 +
|NextPage=Documentation/How_Tos/Calc:_COUNTA_function
 +
}}__NOTOC__
  
 
== COUNT ==
 
== COUNT ==
Line 9: Line 14:
 
<tt>'''value1'''</tt> to <tt>'''value30'''</tt> are up to 30 values or ranges representing the values to be counted.
 
<tt>'''value1'''</tt> to <tt>'''value30'''</tt> are up to 30 values or ranges representing the values to be counted.
  
=== Example: ===
+
=== Examples: ===
  
 
<tt>'''COUNT(2; 4; 6; "eight")'''</tt>
 
<tt>'''COUNT(2; 4; 6; "eight")'''</tt>
Line 17: Line 22:
 
: where cells <tt>'''B1'''</tt>, <tt>'''B2'''</tt>, <tt>'''B3'''</tt> contain <tt>'''1.1'''</tt>, <tt>'''2.2'''</tt>, and <tt>'''apple'''</tt> returns <tt>'''2'''</tt>.
 
: where cells <tt>'''B1'''</tt>, <tt>'''B2'''</tt>, <tt>'''B3'''</tt> contain <tt>'''1.1'''</tt>, <tt>'''2.2'''</tt>, and <tt>'''apple'''</tt> returns <tt>'''2'''</tt>.
  
=== See also: ===
+
<tt>'''COUNT(B1:B3)'''</tt>
[[Documentation/How_Tos/Calc: COUNTA function|'''COUNTA''']],
+
: where cells <tt>'''B1'''</tt>, <tt>'''B2'''</tt>, <tt>'''B3'''</tt> are empty, returns <tt>'''0'''</tt>.
[[Documentation/How_Tos/Calc: COUNTIF function|'''COUNTIF''']],
+
 
[[Documentation/How_Tos/Calc: COUNTBLANK function|'''COUNTBLANK''']],
+
===Issues: ===
[[Documentation/How_Tos/Calc: SUM function|'''SUM''']]
+
* The ODFF standard requires that text representations of numbers are NOT counted. Calc complies to text representations of numbers in cells, in contrast to Excel. However, COUNT(4; "4") will return 2, as inline strings are converted to numbers if possible. This is described in the ODFF standard (28Dec07) in section 2.2 page 35.
 +
 
  
[[Documentation/How_Tos/Calc: Statistical functions|'''Statistical functions''']]
+
{{SeeAlso|EN|
 +
* [[Documentation/How_Tos/Calc: COUNTA function|COUNTA]]
 +
* [[Documentation/How_Tos/Calc: COUNTIF function|COUNTIF]]
 +
* [[Documentation/How_Tos/Calc: COUNTBLANK function|COUNTBLANK]]
 +
* [[Documentation/How_Tos/Calc: SUM function|SUM]]
  
===Issues: ===
+
* [[Documentation/How_Tos/Calc: Statistical functions|Statistical functions]]
* The draft ODFF standard requires error values to be ignored, not propagated as in Calc. See [http://qa.openoffice.org/issues/show_bug.cgi?id=51068 issue 51068].
+
 
 +
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 +
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 +
[[Category: Documentation/Reference/Calc/Statistical functions]]
  
* The draft ODFF standard requires that text representations of numbers are NOT counted. Calc complies for text representations of numbers in cells, in contrast to Excel. However, COUNT(4; "4") will return 2, as inline strings are converted to numbers if possible. This is described in the ODFF standard (28Dec07) in section 2.2 page 35.
+
[[fr:Documentation/FR/Calc:Fonction_NB]]
 +
[[nl:NL/Documentation/How_Tos/Calc:_functie_AANTAL]]

Latest revision as of 13:14, 2 February 2024



COUNT

Counts the numbers in the list of arguments, ignoring text entries.

Syntax:

COUNT(value1; value2; ... value30)

value1 to value30 are up to 30 values or ranges representing the values to be counted.

Examples:

COUNT(2; 4; 6; "eight")

returns 3, because 2, 4 and 6 are numbers ("eight" is text).

COUNT(B1:B3)

where cells B1, B2, B3 contain 1.1, 2.2, and apple returns 2.

COUNT(B1:B3)

where cells B1, B2, B3 are empty, returns 0.

Issues:

  • The ODFF standard requires that text representations of numbers are NOT counted. Calc complies to text representations of numbers in cells, in contrast to Excel. However, COUNT(4; "4") will return 2, as inline strings are converted to numbers if possible. This is described in the ODFF standard (28Dec07) in section 2.2 page 35.




See Also

Personal tools
In other languages