SUM
Adds numeric values across scalars and ranges.
SUM evaluates all arguments, coercing text to numbers where possible,
and returns the total. Blank cells and logical values in ranges are ignored.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=SUM(number1, [number2], ...)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
number1 | number (range) | Required | — |
number2 | number (range) | Optional | — |
Accepts a variable number of arguments. Minimum: 1.
Return type
Number
Differences from Excel
Formualizer accepts a call with no arguments and returns zero. Excel requires the first argument.
Remarks
- If any argument evaluates to an error,
SUMpropagates the first error it encounters. - Unparseable text literals (e.g.,
"foo") will result in a#VALUE!error.
Examples
Add two numeric cells and skip the third cell, which contains the text string N/A.
Formula =SUM(A1:A3)
| A | |
|---|---|
| 1 | 10 |
| 2 | 20 |
| 3 | "N/A" |
Expected result 30
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Add a literal number alongside the range.
Formula =SUM(A1:A3,5)
| A | |
|---|---|
| 1 | 10 |
| 2 | 20 |
| 3 | "N/A" |
Expected result 35
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The sum of a single zero is zero.
Formula =SUM(0)
Expected result 0
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
A division-by-zero error in a supplied argument propagates through SUM.
Formula =SUM(A1:A3,1/0)
| A | |
|---|---|
| 1 | 10 |
| 2 | 20 |
| 3 | "N/A" |
Expected result #DIV/0!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Basic scalar addition
Formula =SUM(10, 20, 5)
Expected result 35
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
Why does SUM return #VALUE! for some text arguments?
Direct scalar text that cannot be parsed as a number raises #VALUE! during coercion.
Do text and logical values inside ranges get added?
No. In ranged inputs, only numeric cells contribute to the total.