Formualizer Docs

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

ArgumentTypeRequiredDefault
number1number (range)Required—
number2number (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, SUM propagates 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)

Input cells
A
110
220
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)

Input cells
A
110
220
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)

Input cells
A
110
220
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?.

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.

Implementation

Engine source

On this page