Math & trig function

SUMX2PY2 function

Adds up the sum of squares (x² + y²) for matching values in two arrays.

Available in All versions of Excel, Excel for the web, Excel for Mac

In every Excel versionWorks in Google Sheets

Syntax

SUMX2PY2(array_x, array_y)
ArgumentWhat it means
array_xRequiredThe first range or array of numbers.
array_yRequiredThe second range, same number of values.

Returns: Σ(x² + y²) over all pairs.

How SUMX2PY2 works

SUMX2PY2 ("sum of x squared plus y squared") squares the values in two matching ranges and adds every square. It equals =SUMSQ(x, y) when both ranges are fully numeric, but it works in pairs: if one value of a pair is text or empty, the whole pair is skipped.

x² + y² is the squared length of a vector with components x and y, so the function turns up with right-angled quantities: wind components, map offsets, or active and reactive power in electrical work, where √(P² + Q²) is the apparent power. Wrap it in SQRT for a single pair to get the length itself.

Examples

1Total squared magnitude across three phases

B5fx=SUMX2PY2(B2:B4, C2:C4)
ABC
1PhaseActive (kW)Reactive (kVAr)
2L1125
3L294
4L3158
5555

Result: 555

(144 + 25) + (81 + 16) + (225 + 64) = 169 + 97 + 289 = 555.

2Resulting wind speed from two components

D2fx=SQRT(SUMX2PY2(B2, C2))
ABCD
1DroneWind X (m/s)Wind Y (m/s)
2Test 1345

Result: 5

√(3² + 4²) = √25 = 5 m/s: the classic 3-4-5 triangle.

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

Common errors and how to fix them

ErrorWhy it happensFix
#N/AThe arrays have different sizes.Make both ranges the same size.

Tips

  • For a per-row length, use =SQRT(B2^2+C2^2) and fill down; SUMX2PY2 always returns one total.

Google Sheets

SUMX2PY2 also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

SUMX2PY2 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
DutchSOM.X2PLUSY2
FinnishNELIÖSUMMIEN.SUMMA
FrenchSOMME.X2PY2
GermanSUMMEX2PY2
HungarianSZUMX2MEGY2
ItalianSOMMA.SOMMA.Q
Norwegian (Bokmål)SUMMERX2PY2
PolishSUMA.X2.P.Y2
Portuguese (Brazil)SOMAX2SY2
Portuguese (Portugal)SOMAX2SY2
RussianСУММСУММКВ
SpanishSUMAX2MASY2
SwedishSUMMAX2PY2
TurkishTOPX2AY2