SUMSQ function
Returns the sum of the squares of the numbers given, e.g. for squared errors or distances.
Available in All versions of Excel, Excel for the web, Excel for Mac
In every Excel versionWorks in Google Sheets
Syntax
SUMSQ(number1, [number2], ...)| Argument | What it means | |
|---|---|---|
number1 | Required | The first number or range. |
number2, ... | Optional | Up to 255 numbers or ranges in total. |
Returns: The total of each value multiplied by itself.
How SUMSQ works
SUMSQ squares every number you give it and adds the squares. Squaring removes the sign and gives large values more weight, which is why sums of squares appear wherever you measure spread or error: forecast accuracy, quality control tolerances, variance calculations and the distance between two points.
=SUMSQ(B2:B6) is the same as =SUMPRODUCT(B2:B6, B2:B6) or =SUM(B2:B6^2) in Microsoft 365. In ranges, text, logical values and empty cells are ignored; typed arguments are converted. Combine it with SQRT for lengths and with COUNT for averages of squares (root mean square).
Examples
1Sum of squared forecast errors
| A | B | |
|---|---|---|
| 1 | Week | Forecast error |
| 2 | W1 | -12 |
| 3 | W2 | 8 |
| 4 | W3 | -3 |
| 5 | W4 | 15 |
| 6 | W5 | -6 |
| 7 | 478 |
Result: 478
144 + 64 + 9 + 225 + 36 = 478. Negative and positive misses both add to the total, and the 15-unit miss counts more than the others together except the 12.
2Straight-line distance from two components
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Leg | East (km) | North (km) | |
| 2 | Delivery route | 3.6 | 4.8 | 6.0 |
Result: 6.0
Pythagoras: √(3.6² + 4.8²) = √36 = 6.0 km as the crow flies (1 decimal shown).
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | A typed argument is non-numeric text. | Use references or numeric values. |
Tips
- Root mean square error:
=SQRT(SUMSQ(B2:B6)/COUNT(B2:B6)). - To square differences between two columns use SUMXMY2 instead of a helper column.
Google Sheets
SUMSQ also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
SUMSQ in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | SUMA.ČTVERCŮ |
| Danish | SUMKV |
| Dutch | KWADRATENSOM |
| Finnish | NELIÖSUMMA |
| French | SOMME.CARRES |
| German | QUADRATESUMME |
| Hungarian | NÉGYZETÖSSZEG |
| Italian | SOMMA.Q |
| Norwegian (Bokmål) | SUMMERKVADRAT |
| Polish | SUMA.KWADRATÓW |
| Portuguese (Brazil) | SOMAQUAD |
| Portuguese (Portugal) | SOMARQUAD |
| Russian | СУММКВ |
| Spanish | SUMA.CUADRADOS |
| Swedish | KVADRATSUMMA |
| Turkish | TOPKARE |