SUMX2MY2 in ONLYOFFICE: Sum of Differences of Squares
Use ONLYOFFICE SUMX2MY2 to compare the squared magnitudes of two equally shaped numeric ranges, with worked signed examples and caveats.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked
Quick answer. SUMX2MY2(array_x, array_y) calculates Σ(x² − y²), not Σ(x − y)². With the five pairs below, =SUMX2MY2(A2:A6,B2:B6) has an independently calculated expected value of −6. A negative result is mathematically valid.
Verification: Examples are independently calculated mathematical expectations, not results observed in ONLYOFFICE.
What the official reference establishes
ONLYOFFICE’s SUMX2MY2 reference calls this a math-and-trigonometry function and documents:
=SUMX2MY2(array_x, array_y)
| Argument (position) | Required? | Type and role stated by ONLYOFFICE | Default |
|---|---|---|---|
array_x (1) |
Yes | First cell range/array supplying x values | None documented |
array_y (2) |
Yes | Second cell range/array supplying y values; same number of rows and columns as array_x |
None documented |
Exactly two arguments are documented. The order is array_x, then array_y; swapping reverses the sign of the mathematical result. The reference does not specify optional arguments, blank/text coercion, numeric precision or explicit shape-error codes. Example formula notation uses English function names and comma-separated arguments.
Shared worksheet: copyable, paired numeric inputs
Open a blank workbook, use English formula language for these examples, and put the following numeric values in A1:B6. The extra C–E columns below show independently calculated row-level checks; they are not input requirements.
A1: x, B1: y. Enter each row’s A and B numbers exactly as shown (including the negative and decimal values):
| Row | A (x) | B (y) | C (x² − y²) | D (x² + y²) | 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 |
| Total | −6 | 86.5 | 58 |
For a row-level verification, type =A2^2-B2^2 in C2, =A2^2+B2^2 in D2, and =(A2-B2)^2 in E2. Fill these formulas down through row 6. Compare each cell against the expected row above. Using ordinary numeric cells avoids undocumented text-conversion behavior. The formula result is expected mathematically, not a result observed in ONLYOFFICE.
Step-by-step function calculation
- Select a blank result cell G2 outside columns A–E.
- Enter
=SUMX2MY2(A2:A6,B2:B6)using the exact order shown; press Enter (or use the Formula tab’s documented Insert Function dialog). - The independent mathematical expectation is -6 for these five pairs.
- For a transparent check, use the applicable C, D or E row-calculation column from the table and sum those five cells. That check uses ordinary operators and the arithmetic results shown; it does not assert a vendor-tested equivalence.
- Try the partial-range, swapped-array and same-array tests in the table below. Each formula uses two same-shaped input ranges.
Further reproducible formulas
| English-locale formula | Expected result | Independent reasoning / interpretation |
|---|---|---|
=SUMX2MY2(A2:A6,B2:B6) |
-6 | Five same-shaped numeric pairs from the worksheet. |
=SUMX2MY2(B2:B6,A2:A6) |
6 | Swapped array order; compare signs and symmetry. |
=SUMX2MY2(A2:A3,B2:B3) |
-4 | Only rows 2–3 are included. |
=SUMX2MY2(A4:A6,B4:B6) |
-2 | Only rows 4–6 are included. |
=SUMX2MY2(A2:A6,A2:A6) |
0 | Both input arrays are the x values. |
=SUMX2MY2(A2:A6,B2:B6)/COUNT(A2:A6) |
-1.2 | Signed average difference in squared magnitudes. |
=SUMX2MY2(A2:A6,B2:B6)+SUMX2MY2(B2:B6,A2:A6) |
0 | Antisymmetry identity. |
=SUMX2MY2(A2:A6,B2:B6)+SUMX2PY2(A2:A6,B2:B6) |
80.5 | Identity equals twice the sum of x² values. |
Interpretation and advanced use
Why negative values are legitimate. Each x² − y² can be negative if the corresponding |y| is larger than |x|; the signed totals are not distances or squared errors. For the worksheet, the row differences are 3, −7, −4, 0, 2, totaling −6. Reversing arrays changes the sign. The official ONLYOFFICE text uses “difference of squares,” and the signature orders array_x first, array_y second.
Advanced: energy imbalance between signals. If each x and y is a paired sampled amplitude, then Σx² − Σy² reports which collection has greater total squared magnitude, with the sign indicating direction. Divide by the number of complete pairs for the mean signed gap, e.g. =SUMX2MY2(A2:A6,B2:B6)/COUNT(A2:A6) expects −1.2. For total squared error between paired predictions, use SUMXMY2 instead.
Cross-check. Mathematically Σ(x² − y²) = Σx² − Σy². With two equal-size numeric arrays, =SUMSQ(A2:A6)-SUMSQ(B2:B6) has expected result −6. The identity is independent mathematics, and the separate SUMSQ reference was checked; native equivalence was not tested.
Errors, troubleshooting and limitations
| Problem or uncertainty | What to check or avoid |
|---|---|
| Unexpected positive versus negative answer | Array order matters: Σ(x²−y²) is the negative of Σ(y²−x²). |
| Expecting a nonnegative error measure | You probably need SUMXMY2 for Σ(x−y)². This function is a signed difference of squares. |
| Different range shapes | The vendor requires array_y to have the same number of rows and columns as array_x. For instance A2:A6 versus B2:B5 violates the stated dimensions; the precise runtime error is not documented on this function page. |
| Blanks, text, booleans or errors in source cells | The short vendor reference provides no exact filtering/coercion policy. Use actual numeric pairs and test any exceptional inputs on the target version rather than claiming they are skipped or treated as zero. |
#VALUE! or another runtime error |
An error message observed elsewhere is not proof of ONLYOFFICE behavior. Check shape, genuine numeric cells and edition; capture the actual message in a controlled native test. |
The function’s short official help page documents the required dimensions but does not supply an explicit #VALUE!/#NUM! rule for mismatch or atypical cells. Consequently these are test cases to run in ONLYOFFICE, not observed error claims. If a formula returns a different answer, record the exact Desktop/web build, workbook locale, cell types and screenshot in a future validation pass.
Desktop, browser, historical releases, and locale accuracy
- Documentation evidence, not native execution: The current English function catalogue lists the function and links to the signature described above. The documentation is for ONLYOFFICE Docs Spreadsheet Editor; it is not a function-by-function guarantee for every hosted Docs deployment or Desktop Editors version.
- Desktop versus web: The Docs changelog and Desktop changelog are distinct release histories. Checked 2026-10-13 UTC, neither was used to establish the first-supported version of this function. Do not claim a minimum release number or tested parity without controlled execution on named versions.
- Formula locale: The ONLYOFFICE function-entry guide demonstrates English function names, comma-separated arguments, parentheses, and an initial
=. The regional settings guide documents configurable formula language, decimal/thousands separators, and region. These examples use English names, commas between arguments, and a dot for decimals. Recheck the user’s formula language and actual separator settings before copying to a localized workbook; no localized execution was performed. - Workbook formats: The presence of the formula in the help catalogue does not, by itself, verify Excel, Google Sheets, OpenDocument or earlier-format round trips. Avoid assuming that an identical spelling guarantees identical coercion, error codes or calculation precision elsewhere.
Related functions — vendor links checked 2026-10-13 UTC
- SUMSQ sums squares of supplied numeric inputs and is useful for independent math cross-checks. It has a distinct argument signature.
- SUMPRODUCT multiplies corresponding values and sums products, useful for the algebraic identities shown above. Its own help page explicitly documents treating nonnumeric entries as zero; that rule must not be transferred to SUMX2MY2 without separate evidence.
- SQRT finds the square root of a number, useful in RMS calculations; negative-input
#NUM!belongs to SQRT’s own documented rule, not to SUMX2MY2. - COUNT counts numeric cells, useful only when observations are paired and complete.
Official sources and claims — verified 2026-10-13 UTC
| Claim checked | Official source | What is—and is not—verified |
|---|---|---|
| Name, purpose, syntax, argument order | ONLYOFFICE SUMX2MY2 reference | The vendor names this exact function; the English reference supplies its signature. |
| Presence in the current function menu | ONLYOFFICE Insert Functions catalogue | The function appears in a current, unversioned Docs list. This is documentation rather than execution evidence. |
| English entry and argument separators | Inserting functions | Documents typing =, function names, comma argument separators in English examples, and the Function Arguments wizard. |
| Locale and translated function names | Spreadsheet Advanced Settings | Documents configurable formula language and regional numeric separators; specific translated spellings were not verified. |
| Release-era limitations | Docs changelog and Desktop changelog | These document separate release tracks. First supported release of SUMX2MY2 remains unconfirmed. |
Verification limitations
Formula values are independently calculated mathematical expectations. Native ONLYOFFICE Desktop/web execution, localized parsing, undocumented coercion, error propagation and extreme-value precision were not tested.
Official references checked: 2026-10-13 UTC. Native release/edition testing: not performed.