Contact

SUMX2MY2 in Calligra Sheets: Syntax, Worked Examples & Array Errors

Statistical Intermediate Calligra Sheets

Subtract squared values of one paired array from another in Calligra Sheets, with official source syntax, detailed examples, source-checked limitations and independent mathematical verification.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Availability and version history

  • Introduced: Documented by 26.08.2; original introduction not established.
  • Availability: Supported in Calligra Sheets 26.08.2, based on the function-specific registration.
  • Scope: The official application listing provides Linux installation; other packaged builds are unverified here.
  • Checked: October 14, 2026. Documentation/source check; no new native test in Calligra Sheets 26.08.2.

Quick answer

Use SUMX2MY2 to compare the total squared magnitude of two arrays: square each x and y, subtract the y square from the x square, and sum over corresponding positions. Because you subtract totals, negative results are perfectly valid and do not necessarily mean an error.

Syntax: =SUMX2MY2(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 -5:

=SUMX2MY2(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

=SUMX2MY2(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. For subtraction-based functions, input order matters.
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.

Do not reverse the arrays casually: SUMX2MY2 computes x² − y² at each matched position. For this five-row fixture, reversing the inputs mathematically gives -11, as explained below.

Reproducible worksheet: exactly five matched pairs

  1. Open a blank Calligra Sheets worksheet. Type X reading in A1 and Y reading in B1.
  2. Type the following numeric cell values, one value per row; make sure negative entries are negative numbers, not text.
  3. Put the independent check formula =A2^2-B2^2 in C2, fill through C6, and compare the expected individual results.
  4. In D2 enter =SUMX2MY2(A2:A6;B2:B6); the independently calculated mathematical expectation is 11. D2 is a separate aggregate formula, not a filled-down formula.
  5. Put =SUM(C2:C6) in D3 for an arithmetic cross-check. The expected total is also 11. 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 -5
3 5 5 0
4 -3 1 8
5 0 -2 -4
6 4 2 12
Total — — 11

Independent calculation: Σ(xᵢ² − yᵢ²) = -5 + 0 + 8 + -4 + 12 = 11. 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 =SUMX2MY2(A2:A6;B2:B6) 11 Full five-pair dataset.
2 =SUMX2MY2(A2:A3;B2:B3) -5 Reproduces KDE’s documented two-pair example in rows 2–3.
3 =SUMX2MY2(A4:A6;B4:B6) 16 Only the last three pairs.
4 =SUMX2MY2(A2:A2;B2:B2) -5 A single pair expressed as one-cell arrays.
5 =SUMX2MY2(B2:B6;A2:A6) -11 Effect of reversing x and y.
6 =SUMX2MY2(A3:A3;B3:B3) 0 Equal values: x=5 and y=5.
7 =SUMX2MY2(A5:A5;B5:B5) -4 Zero x versus negative y.
8 =SUMX2MY2(A6:A6;B6:B6) 12 Final pair.
9 =SUM(C2:C6) after filling C2:C6 11 Independent rowwise reconciliation.
10 =SUMX2MY2(A2:A2;B2:B2)+SUMX2MY2(A3:A6;B3:B6) 11 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. =SUMX2MY2(A10:A12;B10:B12) then has an expected result of -15. 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

Compare total squared magnitude between columns

The five-row fixture gives Σx² = 54 and Σy² = 43. Their difference is 11, matching =SUMX2MY2(A2:A6;B2:B6). To audit each contribution, use =A2^2-B2^2 in C2, fill down to C6, then =SUM(C2:C6).

Observe sign changes when switching arrays

The reversed formula =SUMX2MY2(B2:B6;A2:A6) has the independently calculated result −11. Swapping input order changes the sign because y²−x² = −(x²−y²). Contrast this with SUMXMY2 and SUMX2PY2, which are symmetric when swapping arrays.

Diagnose cancellation

A result of zero does not imply each pair is equal: if x=(2,5) and y=(5,2), the squares total 29 in either array, so the result is 0 despite unmatched positions. For pairwise closeness use SUMXMY2 instead; that same crossed example gives 18.

Interpret the difference of squares

For individual numbers, x²−y² = (x−y)(x+y). You can reproduce the same five-row sum by putting =(A2-B2)*(A2+B2) in a helper column and totaling the cells; its mathematical expectation is 11. This verifies an algebraic identity and is not a native runtime test.

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.
  • A common mistake is confusing x²−y² versus (x−y)². For the first official sample x=(2,5), y=(3,5), these give −5 versus 1, respectively.
  • 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.

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

SUMX2MY2 means x squared minus y squared. SUMXMY2 means the difference x−y, squared. The formulas and numeric results are different. KDE documents both and registers separate implementations. The older name SUM2XMY belongs to SUMXMY2, not this function.

Related reference links checked against KDE’s documentation and pinned source: SUMXMY2 · SUMX2PY2 · 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.