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)| Argument | What it means | |
|---|---|---|
array_x | Required | The first range or array of numbers. |
array_y | Required | The 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
| A | B | C | |
|---|---|---|---|
| 1 | Phase | Active (kW) | Reactive (kVAr) |
| 2 | L1 | 12 | 5 |
| 3 | L2 | 9 | 4 |
| 4 | L3 | 15 | 8 |
| 5 | 555 |
Result: 555
(144 + 25) + (81 + 16) + (225 + 64) = 169 + 97 + 289 = 555.
2Resulting wind speed from two components
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Drone | Wind X (m/s) | Wind Y (m/s) | |
| 2 | Test 1 | 3 | 4 | 5 |
Result: 5
√(3² + 4²) = √25 = 5 m/s: the classic 3-4-5 triangle.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | The 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.
| Language | Function name |
|---|---|
| Dutch | SOM.X2PLUSY2 |
| Finnish | NELIÖSUMMIEN.SUMMA |
| French | SOMME.X2PY2 |
| German | SUMMEX2PY2 |
| Hungarian | SZUMX2MEGY2 |
| Italian | SOMMA.SOMMA.Q |
| Norwegian (Bokmål) | SUMMERX2PY2 |
| Polish | SUMA.X2.P.Y2 |
| Portuguese (Brazil) | SOMAX2SY2 |
| Portuguese (Portugal) | SOMAX2SY2 |
| Russian | СУММСУММКВ |
| Spanish | SUMAX2MASY2 |
| Swedish | SUMMAX2PY2 |
| Turkish | TOPX2AY2 |