SUMX2PY2 in Calligra Sheets: Syntax, Worked Examples & Array Errors
Add squared numbers from two paired arrays in Calligra Sheets, with official source syntax, detailed examples, source-checked limitations and independent mathematical verification.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Calligra Sheets. How formula examples are checked
Quick answer
Use SUMX2PY2 to combine the squared magnitudes of paired observations from two arrays. With real numeric values the mathematical result is nonnegative. It is not the sum of squared differences and not a variance or mean.
Syntax: =SUMX2PY2(array1;array2) → Σ(xᵢ² + yᵢ²), pairing cells at the same row and column positions. For the verified mathematical sample A1=2, A2=5, B1=3, B2=5, the result should be 63:
=SUMX2PY2(A1:A2;B1:B2)
The official KDE handbook and 26.08.2 XML description give this example and this syntax. The 26.08.2 source registration registers exactly two arguments with array acceptance. Numerical results in this guide were independently calculated, not obtained by opening/running Calligra Sheets. A source registration is not proof that a particular Linux/Flatpak installation executes the function identically.
Syntax, argument types, order and defaults
=SUMX2PY2(array1;array2)
| Argument | Required | Source-described type | Meaning |
|---|---|---|---|
array1 |
Yes | Array of numeric / Double values |
Supplies the x observation at each position; the first row/column matches array2’s first position. |
array2 |
Yes | Array of numeric / Double values |
Supplies the y observation at that position. This function is symmetric when the arrays are exchanged. |
| Return | — | Floating-point numeric output | Σ(xᵢ² + yᵢ²), or an internal calculation error for a rejected condition. |
No argument is optional; no default applies. KDE’s 26.08.2 C++ registration calls setParamCount(2) and setAcceptArray() for this exact function. The XML parameter definitions describe two arrays of doubles. Parentheses and semicolons follow KDE’s English-language formula syntax; these examples use . for decimal numbers and do not establish alternate punctuation in other locales.
Swapping the arrays preserves the result: SUMX2PY2 computes x² + y² at each matched position. For this five-row fixture, reversing the inputs mathematically gives 97, as explained below.
Reproducible worksheet: exactly five matched pairs
- Open a blank Calligra Sheets worksheet. Type
X readingin A1 andY readingin B1. - Type the following numeric cell values, one value per row; make sure negative entries are negative numbers, not text.
- Put the independent check formula
=A2^2+B2^2in C2, fill through C6, and compare the expected individual results. - In D2 enter
=SUMX2PY2(A2:A6;B2:B6); the independently calculated mathematical expectation is 97. D2 is a separate aggregate formula, not a filled-down formula. - Put
=SUM(C2:C6)in D3 for an arithmetic cross-check. The expected total is also 97. If your installation disagrees, record the Calligra version, language settings, exact cell types and the visible error instead of assuming the documentation is wrong.
| Worksheet row | Column A (x) | Column B (y) | Expected C row check: x² + y² |
|---|---|---|---|
| 2 | 2 | 3 | 13 |
| 3 | 5 | 5 | 50 |
| 4 | -3 | 1 | 10 |
| 5 | 0 | -2 | 4 |
| 6 | 4 | 2 | 20 |
| Total | — | — | 97 |
Independent calculation: Σ(xᵢ² + yᵢ²) = 13 + 50 + 10 + 4 + 20 = 97. This is ordinary Python integer arithmetic verified on 2026-10-13. It is not a native application test, and no screenshots were created.
Ten reproducible formula checks
Use the same A2:A6 and B2:B6 input data above. Values in this table are mathematically computed expectations; the call to Calligra was not executed. The two-array source’s shape and conversion behavior may affect error cases.
| # | Formula entered | Independent expected result | What it demonstrates |
|---|---|---|---|
| 1 | =SUMX2PY2(A2:A6;B2:B6) |
97 | Full five-pair dataset. |
| 2 | =SUMX2PY2(A2:A3;B2:B3) |
63 | Reproduces KDE’s documented two-pair example in rows 2–3. |
| 3 | =SUMX2PY2(A4:A6;B4:B6) |
34 | Only the last three pairs. |
| 4 | =SUMX2PY2(A2:A2;B2:B2) |
13 | A single pair expressed as one-cell arrays. |
| 5 | =SUMX2PY2(B2:B6;A2:A6) |
97 | Effect of reversing x and y. |
| 6 | =SUMX2PY2(A3:A3;B3:B3) |
50 | Equal values: x=5 and y=5. |
| 7 | =SUMX2PY2(A5:A5;B5:B5) |
4 | Zero x versus negative y. |
| 8 | =SUMX2PY2(A6:A6;B6:B6) |
20 | Final pair. |
| 9 | =SUM(C2:C6) after filling C2:C6 |
97 | Independent rowwise reconciliation. |
| 10 | =SUMX2PY2(A2:A2;B2:B2)+SUMX2PY2(A3:A6;B3:B6) |
97 | Additive partition across disjoint, same-shaped ranges. |
Explicit literal-array setup: You can build a second small test using A10:A12 containing 2, 2, 2 and B10:B12 containing 3, 3, 3 as numbers. =SUMX2PY2(A10:A12;B10:B12) then has an expected result of 39. For a third test with A14:A15 and B14:B15 all zeros, the expected total is 0 for each of the three functions. These worksheet entries are explicit to avoid unsupported literal-array separators.
Advanced uses and independent checks
Calculate a combined squared magnitude
For two readings per sample (A and B), =SUMX2PY2(A2:A6;B2:B6) gives the expected total 97. Dividing that number by 5 produces 19.4, the average per-pair sum of squares, provided there are five valid pairs. It does not calculate a sample variance because it does not subtract a mean.
Cross-check two independent worksheet calculations
Mathematically Σ(x²+y²) = Σx² + Σy². Our fixture yields 54 + 43 = 97. One transparent audit method is to put =A2^2+B2^2 in C2, fill C2:C6 down, then use =SUM(C2:C6) for expected 97. Another approach is to calculate two helper columns of squares and add their totals.
Compare two vector-like measurements
For each row x²+y² is a squared two-dimensional magnitude. The total is the sum of five squared magnitudes; if you want the Euclidean length of the ten-value concatenated vector, mathematically take the square root of 97, approximately 9.8488578018. This result was obtained independently by Python, not by running a Calligra function.
Formula symmetry
Switching array order leaves the result unchanged: =SUMX2PY2(B2:B6;A2:A6) gives the same independently computed 97. This follows from addition being commutative, not from an application-specific sorting rule.
Errors, data typing and troubleshooting
Array-shape mismatch is confirmed in source. KDE’s English handbook says the number of values in the two arrays must match. But the pinned shared array walker additionally checks that the arrays have the same row count and column count. For example, the source branch treats a 1×5 horizontal range and 5×1 vertical range as mismatched even though both contain five cells, and assigns an internal Value::errorVALUE(). This is a source inspection finding, not an observation of a particular error message in the Calligra UI.
Troubleshooting checklist:
- If you see an error or a surprising result, ensure both arrays have identical rectangular dimensions and contain corresponding observations in the same order. Do not simply sort one column independently of the other.
- The two arguments must both be present; one range or a third argument is outside the two-parameter registration.
- Verify a genuine number was entered into each expected numeric cell. Text-formatted numbers, blank cells, Boolean cells, NaN/infinities, dates, and embedded errors have not been natively evaluated here; the implementation’s per-pair callback uses arithmetic helpers but does not supply a general promise about such values.
- If a number differs slightly in final decimals, account for floating-point rounding and cell display precision. Our fixture deliberately uses small integers, so the expected totals are exact in ordinary arithmetic.
- For a localized installation, confirm the argument separator using its built-in function dialog. English KDE documentation uses
;and decimal point examples; other locale syntax was not tested. - Do not use
SUMX2PY2when you needΣ(x−y)²: for this fixture it produces 97 instead of 25. Neither implementation nor XML calls it an error metric; its purpose is to add individual squares. - If this function is absent from your function list, record the precise app/package version; registration in Calligra 26.08.2 source does not certify that every package has the module active. Do not use another spreadsheet’s behavior as a replacement for a Calligra native test.
Unverified error-display details: The actual UI label for the internal value error (including translations) remains unknown. Scalar-versus-range mixes, array literals, missing cells, text, Booleans, formula-produced error cells, and nested arrays need native tests. The C++ handler calls the shared array walker, but code inspection is not proof of every visible result.
How this differs from related functions
The three official function names are separate, not spelling variants:
| Official function | Formula idea | Expected result for A2:A6/B2:B6 |
|---|---|---|
| SUMXMY2 | =SUMXMY2(A2:A6;B2:B6) |
25 |
| SUMX2PY2 | =SUMX2PY2(A2:A6;B2:B6) |
97 |
| SUMX2MY2 | =SUMX2MY2(A2:A6;B2:B6) |
11 |
This function is distinct from both SUMXMY2, which squares each pairwise difference, and SUMX2MY2, which subtracts y². KDE registers all three separately. Neither SUM2XMY nor a punctuation variant is another name for SUMX2PY2.
Related reference links checked against KDE’s documentation and pinned source: SUMXMY2 · SUMX2MY2 · SUMPRODUCT · Calligra formula syntax.
Compatibility, releases and evidence quality
- Version examined: KDE Calligra Sheets 26.08.2 source, release listed 2026-10-08 on the KDE applications page. Reference commit:
72123cc643f6625351139e7df294544255a1056f. This documents source state, not a measured session. - Platform: KDE presents Linux package-manager and Flathub installation routes; check the official Calligra download page. Windows availability and function behavior were not tested; do not promise equivalence.
- Aliases/versions: There is no explicit registered alias for this chosen name in the inspected 26.08.2 catalogue. Adjacent names implement different mathematics.
- Direct documentation check (2026-10-13): English handbook section and pinned XML; numeric output and two-array semantic intention confirmed against the source.
- Source implementation check (2026-10-13): Function registration, per-pair arithmetic, function wrapper, and array-shape/error guard.
- Independent validation: Python 3 integer arithmetic verifies every listed numeric expectation, the full column totals and algebraic identities. Native Calligra execution: not performed. Native screenshots: none.
- Documentation scope: The KDE handbook’s overall revision date is historically older than the examined 26.08.2 source; catalogue/documentation presence cannot prove native behavior of any installed release.
Evidence summary
| Claim | Official source and exact section | Method | Confidence/limitation |
|---|---|---|---|
| Purpose and sample numeric output | KDE official handbook and XML | Documentation read + independent Python calculation | Explicit for small, numeric, paired values. |
| Two required array parameters | 26.08.2 registration | Source read | Registration does not certify package activation. |
| Pairwise x² + y² | C++ helper and wrapper | Source read + arithmetic cross-check | Arithmetic for numeric values; mixed types untested. |
| Shape validation | ValueCalc.cpp | Source read | Internal error condition only; UI string unknown. |
| Separator and entry syntax | Calligra formula help | Documentation read | English examples; alternative locale not executed. |
| Release and platform | KDE release listing and Calligra downloads | Official metadata | No local app/platform install examined. |
Native limitations: Numeric, blank, text, Boolean, mismatched-shape, scalar/range and locale-separator behavior has not been executed in an identified Calligra installation.