SUMX2MY2 Function (OpenOffice Calc)
Use SUMX2MY2 in Apache OpenOffice Calc to subtract paired squared values. Compare the three sum-of-squares functions with checked numeric ranges.
Verification status: Eight ordinary reference formulas were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, through generated native ODF and GUI hard recalculation. Saved identities, inputs and results were checked. How formula examples are checked
Quick answer: =SUMX2MY2(F2:F4;G2:G4) returned -42 in the tested Apache OpenOffice 4.1.16 build. Use the numeric worksheet setup below for these range addresses.
Availability and version history
- Introduced: First release not established; documented by OpenOffice.org 3.3.
- Supported in: Apache OpenOffice 4.1.16; this is a verified release, not a final supported version.
- Scope: Desktop Calc, English function names and semicolon-separated formulas.
- Checked: October 14, 2026. Eight ordinary reference formulas were recalculated from generated ODF in 4.1.16 on Linux x86-64, Build 9816. Source and independent arithmetic were checked.
What SUMX2MY2 returns
SUMX2MY2 calculates Σ(x²−y²) over corresponding positions in two arrays. It subtracts the squared y values from the squared x values. This is different from squaring the pairwise differences, which is SUMXMY2. Release implementation.
Syntax and arguments
SUMX2MY2(ArrayX;ArrayY)
- ArrayX, ArrayY: exactly two corresponding arrays or ranges with the same row and column dimensions.
- Position matters; keep observations aligned. The tests use only ordinary numeric cell ranges.
- Equal element counts alone do not establish equal shape.
Numeric worksheet setup
Enter the following values at the stated addresses. Column I is unused; keep each range’s starting row intact.
| Row | F | G | H | J | K |
|---|---|---|---|---|---|
| 2 | 1 | 2 | 3 | -1 | 1 |
| 3 | 2 | 4 | 2 | 0 | 0 |
| 4 | 3 | 6 | 1 | 1 | -1 |
For the two-by-two examples, enter L2=1, M2=2, L3=3, M3=4 and O2=2, P2=4, O3=6, P3=8. These are numeric cells, not text representations of arrays.
Eight reproducible examples
The native column contains saved 4.1.16 results; independent references use high-precision arithmetic and the stated source rules. Values are shown to twelve decimal places where needed. The range examples use the numeric setup above.
| Formula | Native 4.1.16 result | Independent reference |
|---|---|---|
=SUMX2MY2(F2:F4;G2:G4) |
-42 |
-42 |
=SUMX2MY2(F2:F4;F2:F4) |
0 |
0 |
=SUMX2MY2(F2:F4;H2:H4) |
0 |
0 |
=SUMX2MY2(J2:J4;K2:K4) |
0 |
0 |
=SUMX2MY2(L2:M3;O2:P3) |
-90 |
-90 |
=SUMX2MY2(G2:G4;F2:F4) |
42 |
42 |
=SUMX2MY2(F2:F3;G2:G3) |
-15 |
-15 |
=SUMX2MY2(J2:J4;J2:J4) |
0 |
0 |
Practical worksheet
With F2:F4 containing 1,2,3 and G2:G4 containing 2,4,6, the sum is (1−4)+(4−16)+(9−36)=−42. A negative answer is valid. Swapping the ranges gives 42.
For the same ranges, SUMX2PY2 gives 70 and SUMXMY2 gives 14. Keep the entire function name visible in a worksheet; these three operations solve different arithmetic problems.
Advanced interpretation and checks
For fully numeric aligned ranges, Σ(x²−y²)=Σx²−Σy². It also equals Σ((x−y)(x+y)). Identical arrays return zero. The reflected lists −1,0,1 and 1,0,−1 have equal squared magnitudes, so this function returns zero even though the values differ.
The native two-by-two example uses L2:M3 = [[1,2],[3,4]] and O2:P3 = [[2,4],[6,8]]. Their squared totals are 30 and 120, giving −90. A zero result therefore establishes equality of squared totals, not equality of the arrays.
Boundaries and troubleshooting
The release checks both row and column dimensions. Its shared source loop skips a position when either corresponding element is a string. The present native fixture contains numeric values only; it does not extend that source statement to a comprehensive blank, Boolean or error-cell test.
Large squares can overflow, and subtraction of close squared totals can lose relative precision. No arbitrary precision guarantee follows from the small integer examples. Keep paired inputs aligned and use the function whose algebra matches the intended calculation.
Related functions
Official evidence and checking scope
The generated ODF produced the informational load warning “Not all attributes could be read.” The sheet was hard-recalculated and saved separately. All eight ordinary function identities, inputs and results were reconciled; a stale SUM cache changed from 999999 to 3 and an uncached SUM returned 7. This establishes the stated examples, not every workbook style or invalid input. Other explanatory identities are independent calculations. The authoring-tool XLSX was not executed in OpenOffice, and its preview values are not the native results reported here.