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.
Syntax =SUM(number1, [number2], ...)
=SUM(B2:B6)Arguments
| Name | Required | What to pass |
|---|---|---|
| number1 | Required | The first number, cell, or range to add. |
| number2 | Optional | More 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
| A | B | |
|---|---|---|
| 1 | Item | Amount |
| 2 | Milk | 12.48 |
| 3 | Bread | 8.15 |
| 4 | Chicken | 24.90 |
| 5 | Note | tax |
| 6 | Bananas | 6.37 |
| 7 | Total | 51.90 |
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.