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

From Apache OpenOffice Wiki
Jump to: navigation, search
m
m
 
(20 intermediate revisions by 7 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{DISPLAYTITLE:SUBTOTAL function}}
 +
{{Documentation/CalcFunc MathematicalTOC
 +
|ShowPrevNext=block
 +
|PrevPage=Documentation/How_Tos/Calc:_SUM_function
 +
|NextPage=Documentation/How_Tos/Calc:_SUMIF_function
 +
}}__NOTOC__
  
 
== SUM  ==
 
== SUM  ==
Line 7: Line 12:
 
<tt>'''SUM(number1; number2; ... number30)'''</tt>
 
<tt>'''SUM(number1; number2; ... number30)'''</tt>
  
<tt>'''number1'''</tt> to <tt>'''number30'''</tt> are up to 30 numbers or ranges of numbers whose sum is to be calculated.
+
: <tt>'''number1'''</tt> to <tt>'''number30'''</tt> are up to 30 numbers or ranges/arrays of numbers whose sum is to be calculated.
  
<tt>'''SUM'''</tt> can also be used to sum cells where a specified condition is true - see '''[[Documentation/How_Tos/Conditional Counting and Summation|Conditional Counting and Summation]]'''.  
+
: <tt>'''SUM'''</tt> ignores any text or empty cell within a range or array.
 +
 
 +
: <tt>'''SUM'''</tt> can also be used to sum or count cells where a specified condition is true - see [[Documentation/How_Tos/Conditional Counting and Summation|Conditional Counting and Summation]].
  
 
=== Example: ===
 
=== Example: ===
  
{| border="0"
+
<tt>'''SUM(2; 3; 4)'''</tt>
|<tt>'''SUM(2; 3; 4)'''</tt>
+
 
| returns <tt>'''9'''</tt>, because <tt>'''2'''</tt>+<tt>'''3'''</tt>+<tt>'''4'''</tt> = <tt>'''9'''</tt>.
+
: returns <tt>'''9'''</tt>, because <tt>'''2'''</tt>+<tt>'''3'''</tt>+<tt>'''4'''</tt> = <tt>'''9'''</tt>.
 +
 
 +
<tt>'''SUM(B1:B3)'''</tt>
  
|-
+
: (where cells <tt>'''B1'''</tt>, <tt>'''B2'''</tt>, <tt>'''B3'''</tt> contain <tt>'''1.1'''</tt>, <tt>'''2.2'''</tt>, <tt>'''3.3'''</tt>) returns <tt>'''6.6'''</tt>.
|<tt>'''SUM(B1:B3)'''</tt>
+
| where cells <tt>'''B1'''</tt>, <tt>'''B2'''</tt>, <tt>'''B3'''</tt> contain <tt>'''1.1'''</tt>, <tt>'''2.2'''</tt>, <tt>'''3.3'''</tt> returns <tt>'''6.6'''</tt>.
+
  
|}
+
=== Issues: ===
 +
*In Excel SUM ignores [[Documentation/How_Tos/Calc: Logical functions#Logical values overview|logical values]] (that is, it treats them as 0). In Calc <tt>'''TRUE'''</tt> is 1 and <tt>'''FALSE'''</tt> is 0.
  
=== See also: ===
+
{{SeeAlso|EN|
'''[[Documentation/How_Tos/Calc: SUBTOTAL function|SUBTOTAL function]]''',
+
* [[Documentation/How_Tos/Calc: SUBTOTAL function|SUBTOTAL]]
'''[[Documentation/How_Tos/Calc: DSUM function|DSUM function]]''',
+
* [[Documentation/How_Tos/Calc: DSUM function|DSUM]]
'''[[Documentation/How_Tos/Calc: SUMIF function|SUMIF function]]''',
+
* [[Documentation/How_Tos/Calc: SUMIF function|SUMIF]]
'''[[Documentation/How_Tos/Calc: SUMSQ function|SUMSQ function]]''',
+
* [[Documentation/How_Tos/Calc: SUMSQ function|SUMSQ]]
'''[[Documentation/How_Tos/Calc: SUMPRODUCT function|SUMPRODUCT function]]'''
+
* [[Documentation/How_Tos/Calc: SUMPRODUCT function|SUMPRODUCT]]
 +
* [[Documentation/How_Tos/Calc: Mathematical functions|Mathematical functions]]
 +
* [[Documentation/How_Tos/Conditional Counting and Summation|Conditional Counting and Summation]]
 +
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 +
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
  
'''[[Documentation/How_Tos/Conditional Counting and Summation|Conditional Counting and Summation]]'''
+
[[fr:Documentation/FR/Calc:Fonction SOMME]]
 +
[[Category: Documentation/Reference/Calc/Mathematical functions]]

Latest revision as of 15:46, 31 January 2024

SUM

Sums the contents of cells.

Syntax:

SUM(number1; number2; ... number30)

number1 to number30 are up to 30 numbers or ranges/arrays of numbers whose sum is to be calculated.
SUM ignores any text or empty cell within a range or array.
SUM can also be used to sum or count cells where a specified condition is true - see Conditional Counting and Summation.

Example:

SUM(2; 3; 4)

returns 9, because 2+3+4 = 9.

SUM(B1:B3)

(where cells B1, B2, B3 contain 1.1, 2.2, 3.3) returns 6.6.

Issues:

  • In Excel SUM ignores logical values (that is, it treats them as 0). In Calc TRUE is 1 and FALSE is 0.



See Also
Retrieved from "https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_SUM_function&oldid=259908"
Views
Personal tools
Navigation
Tools
In other languages