Math & trig function

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], ...)
ArgumentWhat it means
number1RequiredThe first number or range.
number2, ...OptionalUp 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

B7fx=SUMSQ(B2:B6)
AB
1WeekForecast error
2W1-12
3W28
4W3-3
5W415
6W5-6
7478

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

D2fx=SQRT(SUMSQ(B2, C2))
ABCD
1LegEast (km)North (km)
2Delivery route3.64.86.0

Result: 6.0

Pythagoras: √(3.6² + 4.8²) = √36 = 6.0 km as the crow flies (1 decimal shown).

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#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.

LanguageFunction name
CzechSUMA.ČTVERCŮ
DanishSUMKV
DutchKWADRATENSOM
FinnishNELIÖSUMMA
FrenchSOMME.CARRES
GermanQUADRATESUMME
HungarianNÉGYZETÖSSZEG
ItalianSOMMA.Q
Norwegian (Bokmål)SUMMERKVADRAT
PolishSUMA.KWADRATÓW
Portuguese (Brazil)SOMAQUAD
Portuguese (Portugal)SOMARQUAD
RussianСУММКВ
SpanishSUMA.CUADRADOS
SwedishKVADRATSUMMA
TurkishTOPKARE