Contact

SUMX2PY2 in ONLYOFFICE: Add Squares of Two Arrays

Math and Trigonometry Intermediate ONLYOFFICE Spreadsheet Editor

Calculate sum of x-squared plus y-squared for paired numeric arrays in ONLYOFFICE, with vector and RMS examples.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: =SUMX2PY2(A2:A6,B2:B6) has the independently expected result 86.5 for the paired data below. It adds x²+y² for each pair. It does not square x+y, which includes an additional cross-product term.

Availability and version history

  • Introduced: The original introduction release and date are not established by the checked sources.
  • Availability: Currently documented in ONLYOFFICE’s rolling function help; no final supported-version endpoint is established.
  • Scope: Shared Spreadsheet Editor documentation. Exact historical availability and parity across individual Docs, Desktop and mobile builds remain unverified.
  • Checked: October 14, 2026, against the official SUMX2PY2 reference. Formula meanings and example outputs were independently checked; no native test of these cases was performed.

Syntax and required dimensions

=SUMX2PY2(array_x, array_y)

Both arguments are required. The official reference requires the same number of rows and columns in both ranges. Equal element counts alone do not satisfy that stated shape requirement if one range is vertical and the other horizontal.

For complete real numeric pairs, the result is nonnegative and swapping the arrays preserves it. The short reference does not enumerate exact error codes, mixed-type handling or extreme-value precision boundaries.

Complete original five-pair worksheet

Create a blank sheet named PairedSquares. Put x, y, Difference of squares, Sum of squares and Squared difference in A1:E1. Enter only the A/B input values first:

Row A: x B: y Expected C: x²−y² Expected D: x²+y² Expected E: (x−y)²
2 2 1 3 5 1
3 -3 4 -7 25 49
4 0 -2 -4 4 4
5 5 5 0 50 0
6 1.5 -0.5 2 2.5 4

Enter =A2^2-B2^2 in C2, =A2^2+B2^2 in D2 and =(A2-B2)^2 in E2. Fill C2:E2 through row 6. In C8, D8 and E8 enter =SUM(C2:C6), =SUM(D2:D6) and =SUM(E2:E6). Expected totals are -6, 86.5 and 58, respectively.

All five pairs are numeric and complete. This makes the three operations directly comparable without relying on undocumented handling of missing or text values.

Preserve all original function checks

Use G for labels and H for these results, outside the original A:E area:

Cell Formula Independent target
H2 =SUMX2PY2(A2:A6,B2:B6) 86.5
H3 =SUMX2PY2(B2:B6,A2:A6) 86.5
H4 =SUMX2PY2(A2:A3,B2:B3) 30
H5 =SUMX2PY2(A4:A6,B4:B6) 56.5
H6 =SUMX2PY2(A2:A6,A2:A6) 80.5
H7 =SQRT(SUMX2PY2(A2:A6,B2:B6)) 9.30053761887 approximately
H8 =SQRT(SUMX2PY2(A2:A6,B2:B6)/COUNT(A2:A6)) 4.15932686862 approximately
H9 =SUMX2PY2(A2:A6,B2:B6)-SUMXMY2(A2:A6,B2:B6) 28.5
H10 =SUMSQ(A2:A6)+SUMSQ(B2:B6) 86.5

H4 and H5 partition the five observations; their sum equals H2. H6 adds each x-square twice, so it equals 2×40.25. H9 isolates twice the dot product, 2×14.25, using the identity x²+y²−(x−y)²=2xy.

Advanced: root mean squared vector length

Treat each row as one two-dimensional vector. Its squared length is the D-column value: 5,25,4,50,2.5. H8 averages those five squared lengths and then takes a square root, giving approximately 4.15932686862.

The denominator is five vectors, not ten component numbers. For a deliberate comparison, put =SQRT(H2/10) in K2. Its independent target is approximately 2.94108823397: the root mean square of all ten separate components, a different quantity.

H7 is different again: it is the square root of the total 86.5, approximately 9.30053761887. Label which aggregate you need instead of describing all three results merely as a vector average. Coordinate units must be compatible for the geometric interpretation.

Why squaring the component sum changes the answer

Keep A:H unchanged. Put Squared component sum in J1 and =(A2+B2)^2 in J2; fill through J6. Expected row results are 9,1,4,100,1. Enter =SUM(J2:J6) in K4; expect 115.

That total exceeds 86.5 by 28.5, the cross-product term already isolated in H9. The discrepancy is expected algebra, not evidence that either function is rounding incorrectly.

Signs affect the cross-term in a square of a sum. SUMX2PY2 instead squares each component separately, so changing only a component’s sign leaves its own squared contribution unchanged.

Check the spelling carefully: SUMX2MY2 subtracts squares and can be negative; SUMXMY2 squares paired differences. This function adds the two individual squares and has no signed cancellation between them.

The original RMS denominator uses COUNT only because every A value has a matching numeric B value. Do not assume that a count of one incomplete column correctly represents all retained pairs. Prepare and align data before calculating an average.

SUMSQ checks the separate magnitude totals, SUMPRODUCT supplies a dot product, and SQRT converts a squared magnitude to its square root. Each helper has its own documented input rules; those rules are not evidence for SUMX2PY2’s unspecified coercion behavior.

The advanced settings reference covers formula language and regional number settings. The examples use English names, commas and decimal points. Matching names in another spreadsheet do not prove identical error behavior or file-format round trips.