Contact

SUMXMY2 in ONLYOFFICE: Sum of Squared Differences

Math and Trigonometry Intermediate ONLYOFFICE Spreadsheet Editor

Measure paired numeric differences using ONLYOFFICE SUMXMY2, with exact sample tables, MSE, RMSE and common mistakes.

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

Quick answer: =SUMXMY2(A2:A6,B2:B6) has the independently expected result 58 for the five pairs below. Each corresponding pair is subtracted before squaring. This is different from subtracting their squares, which gives -6 here.

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 SUMXMY2 reference. Formula meanings and example outputs were independently checked; no native test of these cases was performed.

Syntax and pairing requirements

=SUMXMY2(array_x, array_y)

Both arguments are required. The official reference requires the second range to have the same numbers of rows and columns as the first. Preserve the identity of each paired observation; equally shaped but independently sorted arrays answer a different question.

For complete real numeric inputs, squared differences are nonnegative and reversing the two arrays leaves the total unchanged. The short entry does not specify every blank/text conversion, numeric limit or exact mismatch error.

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.

Complete function and cross-check results

Use G for labels and H for the following formulas, leaving A:E unchanged:

Cell Formula Independent target
H2 =SUMXMY2(A2:A6,B2:B6) 58
H3 =SUMXMY2(B2:B6,A2:A6) 58
H4 =SUMXMY2(A2:A3,B2:B3) 50
H5 =SUMXMY2(A4:A6,B4:B6) 8
H6 =SUMXMY2(A2:A6,A2:A6) 0
H7 =SUMXMY2(A2:A6,B2:B6)/COUNT(A2:A6) 11.6
H8 =SQRT(SUMXMY2(A2:A6,B2:B6)/COUNT(A2:A6)) 3.40587727319 approximately
H9 =SUMX2PY2(A2:A6,B2:B6)-2*SUMPRODUCT(A2:A6,B2:B6) 58

The first two rows contribute 50 and the final three contribute 8. H9 verifies the identity (x−y)²=x²+y²−2xy, using a total squared magnitude of 86.5 and dot product of 14.25. All original examples have distinct output cells.

Advanced: mean squared error and root mean squared error

If A contains predictions and B the observed values in the same row, H2 is total squared error. H7 divides by the five complete pairs to give mean squared error 11.6. H8 takes the square root, producing root mean squared error approximately 3.40587727319.

MSE has squared measurement units; RMSE has the original units. Neither is a signed total error or an automatic sample-variance estimate. Changing the denominator to n−1 or n−2 would define a different calculation that requires its own statistical justification.

Put Signed difference in J1 and =A2-B2 in J2; fill to J6. Expected differences are 1,-7,2,0,2. Put =SUM(J2:J6) in K2; expect -2. The signed errors partly cancel, whereas their squares sum to 58. A small signed total can hide large discrepancies in individual rows.

Demonstrate why matching rows matter

Keep the original data unchanged. On a separate sheet named PairingCheck, put Original x and Reordered y in A1:B1. Enter 2,-3,0,5,1.5 in A2:A6 and -0.5,5,-2,4,1 in B2:B6. This second column contains the same five original y-values in reverse order.

Put =SUMXMY2(A2:A6,B2:B6) in D2; expect 75.5, not 58. Put =(A2-B2)^2 in C2 and fill through C6; expected values are 6.25,64,4,1,0.25. Their sum matches D2.

The range dimensions and individual values have not changed, but their correspondences have. If the rows represent dates, products or cases, sort and join on that shared identity rather than sorting each measurement column alone.

Comparing model errors responsibly

Use the same observations, units and missing-data policy when comparing two RMSE values. A model evaluated only on easy or complete rows is not directly comparable with one evaluated on a different subset. The function does not choose weights or normalize errors for you.

The COUNT denominator is justified here because all five A entries have exactly one numeric B partner. It is not evidence that counting one arbitrary incomplete range gives the number of usable pairs. Investigate missing observations before assigning a denominator.

If you expected a negative total, check whether you meant signed differences rather than squared differences. If you expected -6 for this sample, you meant SUMX2MY2. SUMX2PY2 adds individual squares, and SUMPRODUCT helps explain the cross-product term.

Use genuine numeric pairs and preserve full precision before summing. The short SUMXMY2 entry does not establish all filtering, propagation or overflow behavior for unusual input types, so no exact undocumented error token is promised here. SQRT has separate rules for the final root operation.

Examples use English names, comma-separated arguments and decimal points. Check the formula-language and region settings if local entry differs; a same-name function in another application does not guarantee identical coercion or export behavior.