SUM

Add up numbers, cell ranges, or a mix of both.

Syntax

SUM(number1, [number2], ...)
Argument Required Description
number1 Required A number, a cell reference, or a range such as A2:A100.
number2 Optional Further numbers or ranges to include in the total.

Examples

Every example below was executed against VisiGrid engine 0.19.0 — not transcribed from another vendor's documentation. Reproduce any of them with vgrid calc.

Formula Result Notes
=SUM(A2:A4) 60 Column A holds 10, 20 and 30.
=SUMIFS(A2:A4,B2:B4,"x") 40 Use SUMIFS when the total needs a condition.

Text and blanks inside a range

SUM ignores blank cells and text inside a range rather than erroring. That behaviour is convenient and occasionally dangerous: a column of numbers where one value has been imported as text will total lower than expected, with no error to warn you.

This is a good example of why VisiGrid re-checks results in the browser against its Rust engine. A number-stored-as-text problem does not announce itself — but two independent engines reaching the same wrong-looking total tells you the total is genuinely what the data says, and the data is what needs fixing.

Whole-column references

SUM(A:A) totals the entire column. It is convenient for a scratch calculation and a liability in a model that will grow, because it silently absorbs anything later added to that column — including notes, subtotals, and a copy of the total itself. Prefer an explicit range in anything you intend to keep.

Excel compatibility

Matches Excel's SUM, including its treatment of text and blank cells inside a range as zero rather than an error.

Related functions

Last updated