SUMSQ function
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.
- Available in
- Every current version
- Category
- Math functions
- Returns
- The sum of the squares of every number in the arguments.
- Google Sheets
- Works the same in Google Sheets.
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 below is calculated from the sample sheet by our formula engine, the same one that grades the practice.
| 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 |
Try it live
This is the sample sheet. Change any number or text, or edit a formula, and the results update.
Show the sample data as a table
| Day | Error (units) | ||
| Mon | 3 | 30 | |
| Tue | -4 | 2.738612788 | |
| Wed | 2 | 25 | |
| Thu | -1 |
Practice SUMSQ
Graded instantly, then re-checked on changed data.
Sum of squared errors
E2, use SUMSQ to add up the squared errors for each model. Fill down to E6.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.
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)).
Last reviewed October 2026. Every example result on this page is calculated live by the Spreadsheet Practice formula engine.