# SUM formula generator

> Describe what you need and get a SUM formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested SUM examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/sum · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

SUM adds numbers.

Describe the task at [SUM formula generator](https://spreadsheetpractice.com/tools/formula-generator/sum) and get a SUM formula for Excel and Google Sheets, tested on real data.

## Tested SUM examples

### Sum a whole column without the header

`=SUM(B2:B)`

Google Sheets. Result on the sample sheet: $1,170. [See it and try it](https://spreadsheetpractice.com/formulas/sum-a-whole-column-without-the-header)

### Sum a column

`=SUM(B2:B7)`

Excel. Result on the sample sheet: $2,100.80. [See it and try it](https://spreadsheetpractice.com/formulas/sum-a-column)

### Why does adding cells give a #VALUE! error

`=SUM(B2:B7)`

Excel. Result on the sample sheet: $160.45. [See it and try it](https://spreadsheetpractice.com/formulas/adding-cells-gives-value-error)

### Fix a circular reference in a SUM total

`=SUM(B2:B8)`

Excel. Result on the sample sheet: $18,500. [See it and try it](https://spreadsheetpractice.com/formulas/circular-reference-in-sum-total)

### Calculate percent of row total

`=B2/SUM($B2:$E2)`

Excel. Result on the sample sheet: 4 rows (G2:J5). [See it and try it](https://spreadsheetpractice.com/formulas/percent-of-row-total)

### Calculate the percentage of a total

`=B2/SUM($B$2:$B$7)`

Excel. Result on the sample sheet: 6 rows (C2:C7). [See it and try it](https://spreadsheetpractice.com/formulas/percentage-of-total)

### Calculate percent of grand total in a table

`=B2/SUM($B$2:$D$5)`

Excel. Result on the sample sheet: 4 rows (F2:H5). [See it and try it](https://spreadsheetpractice.com/formulas/percent-of-grand-total-in-a-table)

### Fix #REF! after deleting a column

`=SUM(B2:E2)`

Excel. Result on the sample sheet: 4 rows (F2:F5). [See it and try it](https://spreadsheetpractice.com/formulas/ref-error-after-deleting-a-column)

## Questions

### What does the SUM formula generator do?

You describe the task in plain English, and it writes the formula, using SUM where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does SUM do?

SUM adds numbers.

### Can I learn to write SUM formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the SUM function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
