Contact

SUMX2PY2 Function (OpenOffice Calc)

Math Intermediate OpenOffice Calc

Add paired squared values with SUMX2PY2 in Apache OpenOffice Calc. Follow numeric-range examples and distinguish squared sums from squared differences.

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: =SUMX2PY2(F2:F4;G2:G4) returned 70 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 SUMX2PY2 returns

SUMX2PY2 returns Σ(x²+y²) for corresponding positions in two equally shaped arrays. It adds the individual squares; it does not square x+y and does not calculate squared differences. Release implementation.

Syntax and arguments

SUMX2PY2(ArrayX;ArrayY)
  • ArrayX, ArrayY: exactly two corresponding arrays or ranges. Their row and column dimensions must match.
  • Use aligned numeric observations. The native examples use explicit typed numeric cell ranges.
  • Do not infer general scalar broadcasting or automatic reshaping from equal-sized lists.

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
=SUMX2PY2(F2:F4;G2:G4) 70 70
=SUMX2PY2(F2:F4;F2:F4) 28 28
=SUMX2PY2(F2:F4;H2:H4) 28 28
=SUMX2PY2(J2:J4;K2:K4) 4 4
=SUMX2PY2(L2:M3;O2:P3) 150 150
=SUMX2PY2(G2:G4;F2:F4) 70 70
=SUMX2PY2(F2:F3;G2:G3) 25 25
=SUMX2PY2(J2:J4;J2:J4) 4 4

Practical worksheet

Put 1,2,3 in F2:F4 and 2,4,6 in G2:G4. Their squared totals are 14 and 56, so =SUMX2PY2(F2:F4;G2:G4) gives 70. Swapping the ranges leaves the same result.

Using F2:F4 twice gives 28, twice its squared magnitude. This is not the square of the total 1+2+3, which would be 36, and it is not the paired squared-difference sum, which would be zero for identical ranges.

Advanced interpretation and checks

For complete numeric ranges, the operation equals the sum of the two separate squared magnitudes. For the two-by-two arrays [[1,2],[3,4]] and [[2,4],[6,8]], it gives 30+120=150.

The identity SUMX2PY2(X;Y)=SUMXMY2(X;Y)+2*SUMPRODUCT(X;Y) follows by expanding each squared difference. For the three-value example, SUMPRODUCT is 28, so 14+2*28=70. This independent algebra check does not replace the source’s requirements for matching shapes and numeric handling.

Boundaries and troubleshooting

In the pinned implementation, the shared loop ignores a paired position when either element is a string. Blank, Boolean, error-cell and shape-mismatch behavior was not executed in this ordinary numeric fixture, so those inputs should be validated separately.

For finite real numeric data, the mathematical sum is nonnegative, but very large values can overflow. The listed small integer cases establish their exact results without proving behavior for all magnitudes. Avoid changing range boundaries independently when extending a worksheet.

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.