Function · Math

Excel SUM function

The Excel SUM function adds numbers in a range and skips text and blank cells. Syntax, a grocery receipt, and the errors it does not hide.

All current Excel versions. Also in Excel for the web and Google Sheets.

Syntax =SUM(number1, [number2], ...)

SUM
=SUM(B2:B6)

Arguments

NameRequiredWhat to pass
number1RequiredThe first number, cell, or range to add.
number2OptionalMore numbers or ranges, up to 255 arguments. A range such as B2:B6 is one argument.

Examples

A grocery receipt with a text note in the amount column

=SUM(B2:B6)

Result $51.90

=SUM(B2:B6)B7
Receipt
AB
1ItemAmount
2Milk12.48
3Bread8.15
4Chicken24.90
5Notetax
6Bananas6.37
7Total51.90
A picture of the sheet. The word tax sits in the amount column and SUM skips it.

SUM is the function behind almost every total on a sheet. Give it a range and it adds the numbers. Blank cells and text in that range are skipped. That is usually what you want on a receipt. It is the wrong behavior when a “number” was imported as text: the cell looks numeric, SUM ignores it, and the total is quietly short.

The grocery total above is $51.90. The word tax in the amount column does not change it. If that cell had been the text 6.37 instead of a number, SUM would have skipped it too. A quick check is =COUNT(B2:B6), which counts numbers only. Four numbers in that range means one cell was not numeric.

SUM also adds any SUM cells you include in the range, so a total that sits inside the block is counted twice. Keep the total outside the range it adds. Subtotal rows that should ignore other subtotals are a job for SUBTOTAL, not another SUM. SUMSQ adds the squares of the numbers. SUMSQ(3, 4) is 25.