This is documentation for Mathematica 9, which was
based on an earlier version of the Wolfram Language.
BUILT-IN MATHEMATICA SYMBOL

# Total

Total[list]
gives the total of the elements in list.

Total[list, n]
totals all elements down to level n.

Total[list, {n}]
totals elements at level n.

Total[list, {n1, n2}]
totals elements at levels through .

## Details and OptionsDetails and Options

• Total[list] is equivalent to Apply[Plus, list]. »
• Total[list, Infinity] totals all elements at any level in list. »
• For a 2D array or matrix: »
•  Total[list] or Total[list, {1}] totals for each column Total[list, {2}] totals for each row Total[list, 2] overall total of all elements
• Total[f[e1, e2, ...]] gives the sum of the for any head f. »
• Total[list, Method->"CompensatedSummation"] uses compensated summation to reduce numerical error in the result. »
• Total works with SparseArray objects. »

## ExamplesExamplesopen allclose all

### Basic Examples (1)Basic Examples (1)

Total the values in a list:

 Out[1]=