summaryrefslogtreecommitdiffstats
path: root/helpcontent2/source/text/scalc/01/func_sum.xhp
blob: 3aef7d8edfcb1c3ca5934bb1a301f4edb1925862 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">
<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 *
-->

<meta>
  <topic id="calcfuncsum" indexer="include" status="PUBLISH">
    <title id="tit" xml-lang="en-US">SUM Function</title>
    <filename>/text/scalc/01/func_sum.xhp</filename>
  </topic>
</meta>
<body>
  <section id="func_sum">
    <bookmark id="bm_id691636401721449" xml-lang="en-US" branch="hid/SC_HID_FUNC_SUMME" localize="false"/>
    <bookmark xml-lang="en-US" branch="index" id="id431636401649762">
      <bookmark_value>SUM function</bookmark_value>
      <bookmark_value>adding;numbers in cell ranges</bookmark_value>
    </bookmark>
    <h1 id="hd_id121636398275790"><variable id="sum_head"><link href="text/scalc/01/func_sum.xhp">SUM</link></variable></h1>
    <paragraph id="par_id491636401806866" role="paragraph"><variable id="func_sum_desc"><ahelp hid=".">Adds a set of numbers.</ahelp></variable></paragraph>
  </section>

  <embed href="text/scalc/01/ful_func.xhp#func_head_syntax"/>
  <paragraph id="par_id3163656" role="code" xml-lang="en-US">SUM(<embedvar href="text/scalc/01/ful_func.xhp#number255_1" markup="keep"/>)</paragraph>
  <embed href="text/scalc/01/ful_func.xhp#number255"/>
  <embed href="text/scalc/01/common_func.xhp#datenumbersequencenote"/>
  <embed href="text/scalc/01/ful_func.xhp#func_head_example"/>
  <paragraph id="par_id3163704" role="paragraph" xml-lang="en-US"><input>=SUM(2;3;4)</input> returns 9.</paragraph>
  <paragraph id="par_id3151740" role="paragraph" xml-lang="en-US"><item type="input">=SUM(A1;A3;B5)</item> calculates the sum of the three cells.</paragraph>
  <paragraph id="par_id931636109030406" role="paragraph" xml-lang="en-US"><item type="input">=SUM(A1:E10)</item> calculates the sum of all cells in the A1 to E10 cell range.</paragraph>
  <paragraph id="par_id3151756" role="paragraph" xml-lang="en-US">A formula such as <input>=SUM((A1:A40&gt;=C1)*(A1:A40&lt;C2)*B1:B40)</input> may be entered as an <link href="text/scalc/01/04060107.xhp">array formula</link> by pressing the Shift<switchinline select="sys"><caseinline select="MAC">+Command</caseinline><defaultinline>+Ctrl</defaultinline></switchinline>+Enter keys instead of simply pressing the Enter key to finish entering the formula. The formula will then be shown in the Formula bar enclosed in braces and operates by multiplying corresponding elements of the arrays together and returning their sum.</paragraph>

  <section id="relatedtopics">
    <tip id="par_id771677014538669"><link href="https://wiki.documentfoundation.org/Documentation/Calc_Functions/SUM">SUM wiki page</link>.</tip>
    <paragraph id="par_id381636401121931" role="paragraph" localize="false">
	  <embedvar href="text/scalc/01/04060106.xhp#sumif_head"/>,
	  <embedvar href="text/scalc/01/func_sumifs.xhp#sumifs_head"/>
    </paragraph>
  </section>

</body>
</helpdocument>