Maths function
SUM function in Google Sheets and Excel
SUM adds numbers: a range, single cells or several ranges at once, skipping text and empty cells.
Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet
- Excel 2016
- Excel 2019
- Excel 2021
- Excel 2024
- Microsoft 365
- Google Sheets
Syntax
SUM(number1, [number2], ...)Arguments in [brackets] are optional. Google Sheets writes it SUM(value1, [value2, ...]).
Example
=SUM(D2:D9) reads: Add up every number from D2 down to D9: the eight reps' August sales.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Rep | Region | Jul | Aug | Sep | Target |
| 2 | Amara Osei | North | $12,400 | $13,100 | $11,800 | $36,000 |
| 3 | Ben Fischer | South | $9,800 | $10,250 | $12,100 | $30,000 |
| 4 | Lina Chen | East | $15,200 | $14,800 | $16,900 | $45,000 |
| 5 | Diego Alvarez | West | $8,700 | $9,100 | $8,400 | $28,000 |
| 6 | Eva Novak | North | $11,200 | $12,600 | $13,900 | $36,000 |
| 7 | Farid Haddad | South | $13,300 | $12,900 | $14,100 | $39,000 |
| 8 | Grace Kim | East | $10,100 | $9,600 | $10,800 | $33,000 |
| 9 | Hugo Martin | West | $14,500 | $15,800 | $15,100 | $42,000 |
| 10 | Total | $98,150 |
D10 shows $98,150: the eight August figures from D2 to D9 added up.
How the spreadsheet calculates it
Adds up D2:D9.
- 1. SUM: Adds up
D2:D9.range=`D2:D9`: the cells to add. Empty cells and text are skipped
More SUM examples
=SUM(C2:E2)One rep's quarter: July to September on row 2.=SUM(C2:E9)Every rep's sales for all three months, in one rectangular range.=SUM(C2:C9,E2:E9)July and September only: two ranges separated by a comma.=SUM($D$2:D2)A running total when filled down the column.=SUM(D:D)Every number in column D, including rows added later.
Paste any of these into the formula explainer to see it step by step.
Tips
- Add a range (D2:D9) rather than D2+D3+…: rows inserted inside the range are included automatically.
- Keep the total outside the range it adds, usually in the row just below.
- To check a total, select the cells and compare with the Sum shown in the status bar.
- Use
$to lock the first cell for a running total that you fill down.
What SUM is used for
Totals at the bottom of a column, quarterly figures across a row, budget and expense totals, and as the outer function around other results, such as adding a column of quantity × price amounts. It's the first function most people learn, and still the one used most.
Arguments
| Argument | Required | What it is |
|---|---|---|
| number1 | Yes | The first number, cell or range to add, such as D2:D9.Watch out: A space instead of a comma between two ranges, =SUM(B2:B5 D2:D5), asks for the cells the ranges share and gives #NULL!. |
| number2, ... | No | Up to 255 numbers, cells or ranges in all, separated by commas. SUM adds them all together. |
Common mistakes
Leaving out the brackets or the colon:
=SUM D2 D9isn't a formula.Including the total's own cell (
=SUM(D2:D10)in D10): a circular reference the spreadsheet refuses.Numbers stored as text (often pasted from a website or an export, and aligned to the left) are skipped, so the total comes out too small or 0.
Typing a number over the total to "fix" it: the cell stops being a formula and never updates again when the data changes.
In Google Sheets
Google Sheets' SUM takes the same arguments (Google calls them value1, value2…), so a SUM formula works unchanged in both apps.
Errors you may see with SUM
- Circular reference: The range includes the cell the SUM is in, such as `=SUM(D2:D10)` typed in D10, or `=SUM(D:D)` inside column D.
- #REF!: A cell or column the formula named was deleted: `=SUM(B2,C2,D2)` becomes `=SUM(B2,#REF!,C2)`. A range like B2:D2 shrinks instead of breaking.
- #NULL!: Two ranges separated by a space instead of a comma, which asks for their overlap; there isn't one.
Questions
Why does SUM return 0?
Usually the numbers are stored as text, for example after pasting from a website or a CSV. SUM skips text, so check one cell with ISNUMBER: FALSE means it's text. Convert the column with VALUE (see clean up messy text). If the total doesn't change when you edit a number, calculation may be set to manual: formula not calculating.
How do I add up a whole column?
Use a column reference: =SUM(D:D) adds every number in column D, including rows added later. Put the formula in another column, or it includes itself.
Can SUM add cells from different places?
Yes. Separate them with commas: =SUM(C2:C9, E2:E9, F5) adds July, September and one more cell in a single formula.
What's the difference between SUM and SUMIF?
SUM adds everything in the range. SUMIF adds only the rows that match one condition, and SUMIFS takes several. See SUMIF vs SUMIFS.
How do I make a running total?
Lock the start of the range and leave the end free: =SUM($D$2:D2) filled down grows one row at a time, so each row shows the total so far.
Sources
Official documentation the facts on this page were checked against.