SUMX2PY2 in Google Sheets: Add Paired Squared Magnitudes
Calculate Sheets SUMX2PY2 with complete numeric pairs, independent squared totals, norm comparisons and clear distinctions from squared sums.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: SUMX2PY2 adds the x²+y² contributions from two corresponding arrays. For x values 2,5,−1 and y values 1,−2,3, the independently expected result is 44, from squared totals 30+14.
Availability and version history
- Introduced: first service launch date is not established by the official history reviewed; no numbered desktop introduction is assigned.
- Availability: documented in the rolling Google Sheets service. Examples target ordinary web-spreadsheet cells; mobile clients and imported file modes are not separately certified.
- Checked: October 14, 2026; official SUMX2PY2 reference. Documentation and independently calculated examples, without native Sheets execution.
Syntax and controlled pairing
=SUMX2PY2(array_x, array_y)
Both arguments are required arrays or ranges. Google defines the sum of the two squares for each pair, followed by the total across the data. This guide uses equal-shaped numeric ranges with no missing observations.
The result is a scalar. It is different from squaring x+y or from summing the unsquared values. The short official help does not establish every mixed-type, mismatched-shape or native error behavior.
Example 1: inspect the full source table
Enter these numeric pairs in A1:B4:
| Row | A · x | B · y |
|---|---|---|
| 1 | x | y |
| 2 | 2 | 1 |
| 3 | 5 | -2 |
| 4 | -1 | 3 |
=SUMX2PY2(A2:A4,B2:B4)
Expected result: 44. The row contributions are 5,29 and 10, calculated as 4+1, 25+4 and 1+9. Negative input signs disappear within their individual squares.
Keep the x and y labels outside the selected ranges. These controls use comma function separators and ordinary numeric cells in the English-locale worksheet style.
Example 2: verify row contributions and column totals
In C2 enter and fill through C4:
=A2^2+B2^2
Expected C2:C4 values are 5,29,10. Summing those three values gives 44. Independently compare:
=SUMSQ(A2:A4)+SUMSQ(B2:B4)
The first squared total is 30 and the second 14, again giving 44. The identity is checked for complete numeric inputs, not offered as a blanket statement about how every function handles blank or text cells.
Advanced example: squared sums include a cross term
For the same input rows, x+y gives 3,3,2. Squaring those sums produces 9,9,4, totaling 22, which is not 44.
The algebraic reason is (x+y)²=x²+2xy+y². Here the products xy are 2,−10,−3, totaling −11. Adding twice that cross-product total to 44 gives 44−22=22.
Use a helper =(A2+B2)^2 if squared sums are the intended measure. The similar function name is not a substitute for specifying where the parentheses belong.
Advanced example: compare one total norm with a sum of row lengths
For each row, the square root of x²+y² is a two-coordinate length. The independently expected row lengths are approximately 2.236067977, 5.385164807 and 3.162277660.
Their sum is approximately 10.783510445. By contrast:
=SQRT(SUMX2PY2(A2:A4,B2:B4))
Expected result: 6.633249581, the square root of 44. Taking one square root after totaling all squares does not equal adding separate row square roots.
Choose the geometry or summary definition first. The single norm treats all six coordinates as one vector; the sum treats the three two-coordinate rows as separate lengths.
Advanced check: reverse arrays and negate inputs
=SUMX2PY2(B2:B4,A2:A4)
=SUMX2PY2(A2:A4,A2:A4)
Expected results are 44 and 60. Reversing the arrays leaves the sum of squared totals unchanged. Comparing x with itself doubles its squared total 30 rather than producing zero.
Negating either complete input column also leaves the result unchanged because squaring removes the sign. These identities distinguish a squared magnitude from SUMXMY2, whose identical-array result is zero.
Advanced example: compare common scaling and a common shift
Doubling every original coordinate gives expected result 176, four times 44. The squared unit changes quadratically with a common scale factor.
Adding 10 to every value gives x 12,15,9 and y 11,8,13. Their squared totals are 450 and 354, so SUMX2PY2 becomes 804. The function measures squared magnitudes relative to zero, so changing the origin changes the result.
A nonnegative result is expected for these finite real numeric inputs. It does not imply that missing-data policy, row correspondence or physical units were appropriate.
Evidence and native limits
The official definition and syntax were retrieved in Google’s indexed help. A later direct refresh returned a rate limit and was not retried; no native output was captured. The review therefore certifies the documented operation and independent examples, not an expanded error matrix.
Preserve complete pairs, choose same-shaped ranges and test required text, blank, mismatched-length or very large-number cases in the target file. For a difference of squared totals, use SUMX2MY2 instead.
References and verification
Inputs are fictional. Approximate answers are independent mathematical expectations rounded to nine places, not captured native results. Complete type/error matrices, extreme-magnitude accuracy and cross-client behavior remain untested.