# SUMSQ function in Excel

> SUMSQ squares each number and adds the squares.

Source: https://spreadsheetpractice.com/functions/sumsq · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** SUMSQ squares each number and adds the squares.
- **Syntax:** `=SUMSQ(number1, [number2], ...)`
- **Most common use:** `=SUMSQ(B2:B5)` returns 30 (Sum of squared errors: negatives count fully, 9 + 16 + 4 + 1 = 30)
- **Available in:** Every current version
- **Category:** [Math functions](https://spreadsheetpractice.com/functions/category/math)
- **Returns:** The sum of the squares of every number in the arguments.
- **Google Sheets:** Works the same in Google Sheets.

## What it does

SUMSQ squares each number and adds the squares. It's the building block for sums of squared errors, root mean squared error (RMSE) and distance calculations, and it saves writing a helper column of squares.

## Syntax

`=SUMSQ(number1, [number2], ...)`

| Argument | Required? | What it is |
|---|---|---|
| `number1` | Required | The first number, cell or range to square and add. |
| `number2` | Optional | More numbers, cells or ranges. You can list up to 255. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| D2 | `=SUMSQ(B2:B5)` | 30 | Sum of squared errors: negatives count fully, 9 + 16 + 4 + 1 = 30 |
| D3 | `=SQRT(SUMSQ(B2:B5)/COUNT(B2:B5))` | 2.738612788 | Root mean squared error (RMSE): about 2.74 |
| D4 | `=SUMSQ(3,4)` | 25 | Typed numbers work too: 9 + 16 = 25 |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D |
|---|---|---|---|---|
| 1 | Day | Error (units) |  |  |
| 2 | Mon | 3 |  | 30 |
| 3 | Tue | -4 |  | 2.738612788 |
| 4 | Wed | 2 |  | 25 |
| 5 | Thu | -1 |  |  |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| Wanted the square of the total | SUMSQ adds squares; it doesn't square the sum. For (a+b)², use =SUM(B2:B5)^2. |
| Some values are missing from the result | Numbers stored as text inside a range are skipped. Convert them to numbers first. |
| #VALUE! | A typed argument is text, such as =SUMSQ(3,"four"). |

## Tips

- The difference of two ranges squared and summed: =SUMPRODUCT((B2:B10-C2:C10)^2), since SUMSQ can't subtract ranges itself.

## Related functions

- [SUMPRODUCT](https://spreadsheetpractice.com/functions/sumproduct): SUMPRODUCT multiplies matching items in two or more ranges and adds the results.
- [SQRT](https://spreadsheetpractice.com/functions/sqrt): SQRT returns the square root of a number: the value that, multiplied by itself, gives the number.
- [POWER](https://spreadsheetpractice.com/functions/power): POWER raises a number to a power, the same as the ^ operator.

## Questions

### How do I calculate the sum of squares in Excel?

Use =SUMSQ(A2:A20). It squares each value and adds the results.

### How do I calculate RMSE in Excel?

If the errors are in B2:B20, use =SQRT(SUMSQ(B2:B20)/COUNT(B2:B20)).

## Practice

A graded SUMSQ exercise ("Sum of squared errors") is on [the SUMSQ page](https://spreadsheetpractice.com/functions/sumsq). It is checked instantly, then re-checked on changed data.

---

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