SUMX2PY2 in ONLYOFFICE: Add Squares of Two Arrays
Calculate sum of x-squared plus y-squared for paired numeric arrays in ONLYOFFICE, with vector and RMS examples.
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. SUMX2PY2(array_x, array_y) adds each pair’s individual squares: Σ(x²+y²). With the worksheet data, =SUMX2PY2(A2:A6,B2:B6) has an independently calculated expected value of 86.5. It is not Σ(x+y)².
Verification: Examples are independently calculated mathematical expectations, not results observed in ONLYOFFICE.
What the official reference establishes
ONLYOFFICE’s SUMX2PY2 reference calls this a math-and-trigonometry function and documents:
=SUMX2PY2(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 the two arrays leaves the mathematical result unchanged. 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
=SUMX2PY2(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 86.5 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 |
|---|---|---|
=SUMX2PY2(A2:A6,B2:B6) |
86.5 | Five same-shaped numeric pairs from the worksheet. |
=SUMX2PY2(B2:B6,A2:A6) |
86.5 | Swapped array order; compare signs and symmetry. |
=SUMX2PY2(A2:A3,B2:B3) |
30 | Only rows 2–3 are included. |
=SUMX2PY2(A4:A6,B4:B6) |
56.5 | Only rows 4–6 are included. |
=SUMX2PY2(A2:A6,A2:A6) |
80.5 | Both input arrays are the x values. |
=SQRT(SUMX2PY2(A2:A6,B2:B6)) |
9.30053761887 | Euclidean norm of all paired components. |
=SQRT(SUMX2PY2(A2:A6,B2:B6)/COUNT(A2:A6)) |
4.15932686862 | Root mean squared 2D magnitude over five observations. |
=SUMX2PY2(A2:A6,B2:B6)-SUMXMY2(A2:A6,B2:B6) |
28.5 | Twice the dot product: 2Σxy. |
Interpretation and advanced use
Squared vector magnitude. If each x–y pair is a 2D vector, then x² + y² is that observation’s squared length. The row contributions are 5, 25, 4, 50, 2.5, totaling 86.5. The sum is nonnegative for real numeric inputs and is symmetric when the two arrays are swapped.
Advanced: aggregate RMS vector length. =SQRT(SUMX2PY2(A2:A6,B2:B6)/COUNT(A2:A6)) has expected value 4.15932686862. This divides by five observations, not by ten component values; it is the root mean squared 2D vector length. Empty cells and nonnumeric data should be handled before using COUNT as a denominator because no behavior for mixed-type arrays was verified.
Cross-check. The identity Σ(x²+y²) = Σx²+Σy² means =SUMSQ(A2:A6)+SUMSQ(B2:B6) is expected to produce 86.5. Also Σ(x²+y²)−Σ(x−y)² = 2Σxy, which produces 28.5 for the sample. This is independent mathematical validation, not a report of ONLYOFFICE evaluating either expression.
Errors, troubleshooting and limitations
| Problem or uncertainty | What to check or avoid |
|---|---|
Confusing SUMX2PY2 with Σ(x+y)² |
The formula squares x and y separately, then adds the squares; the cross-term 2xy is absent. |
| Different range shapes | SAME row/column counts are required by the official reference. Do not pair A2:A6 with B2:B5. The documentation does not identify the exact error string. |
| Negative total in a real-number calculation | The pure mathematical definition is nonnegative. Re-check source values, formula spelling and any observed editor error rather than asserting an unexplained negative result is valid. |
| Non-numeric/blank data | The official page does not state how each value type is coerced, filtered or reported. Prepare numeric cells and separately test unusual types in the required editor version. |
| Huge squared values / rounding | Squaring increases magnitude and may magnify numeric overflow or precision problems. No exact ONLYOFFICE threshold is stated in the page. |
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 SUMX2PY2 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 SUMX2PY2. - 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 SUMX2PY2 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 SUMX2PY2 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.