SUMX2MY2 Function (Gnumeric)
Learn the SUMX2MY2 function in Gnumeric: Returns the sum of the difference of squares of two arrays.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Gnumeric. How formula examples are checked
SUMX2MY2 adds the differences between corresponding squares: for each pair X and Y it calculates X² − Y², then totals those differences. The result can be negative. It is not the sum of squared deviations: that different operation is SUMXMY2. A useful application is comparing the total squared magnitude of two consistently scaled measurement series.
Exact syntax: =SUMX2MY2(array0,array1)
Validation limits: Expected outputs are independent arithmetic predictions; no native Gnumeric execution or screenshots were performed.
Gnumeric version, syntax and inputs
The English-language Gnumeric Mathematics function reference documents this function with two required positional array arguments, array0 followed by array1; neither argument has a default. Use equal-length, correspondingly ordered numeric cell ranges for the reproducible examples. These are arrays/ranges, not two independent single numbers to multiply or add. The corresponding row positions define each pair.
| Argument | Required? | Meaning | This guide’s value |
|---|---|---|---|
array0 |
Yes | First area/range of numeric observations, X | A2:A6 |
array1 |
Yes | Second area/range of numeric observations, Y | B2:B6 |
The published English syntax uses a comma between arguments. Region-dependent formula presentation can vary; when a formula is rejected, first check your Gnumeric locale and argument separator rather than assuming another spreadsheet’s syntax applies. Use the exact English function name shown here.
Gnumeric’s upstream download index identifies 1.12.62 (21 September 2026) as the latest 1.12 source release at this review date. The Gnumeric web catalogue independently lists this function as Complete with Basic upstream test coverage. These are documentation and implementation-status claims, not native execution of this tutorial. Linux/Unix desktop installations are within the project scope; platform-specific availability for a particular package, a Windows build, and any other spreadsheet’s precise coercion behavior were not tested.
Reproducible practice sheet: two matched five-row series
In a blank worksheet, put Series X into A1, Series Y into B1, and the following numeric values into A2:B6. The extra columns in the table are manual arithmetic for explanation—you need only enter columns A and B.
| Row | A: series X | B: series Y | A² | B² | A² − B² | A² + B² | (A − B)² |
|---|---|---|---|---|---|---|---|
| 2 | 1 | 2 | 1 | 4 | −3 | 5 | 1 |
| 3 | 2 | 1 | 4 | 1 | 3 | 5 | 1 |
| 4 | 3 | 4 | 9 | 16 | −7 | 25 | 1 |
| 5 | 4 | 3 | 16 | 9 | 7 | 25 | 1 |
| 6 | 5 | 6 | 25 | 36 | −11 | 61 | 1 |
| Total | 55 | 66 | −11 | 121 | 5 |
Use the five paired observations, not six cells including headers. To reproduce the result, enter the formula into a blank result cell, such as D2. For each row, the formula evaluates the two numeric inputs at the same position and combines them using the operation below.
Main formula and independently calculated result
=SUMX2MY2(A2:A6,B2:B6)
Expected output: -11 (independent arithmetic; not observed in Gnumeric). By row, (1²−2²)+(2²−1²)+(3²−4²)+(4²−3²)+(5²−6²) = −3+3−7+7−11 = −11. An equivalent way to understand the result in this fully numeric example is SUMSQ(A2:A6)−SUMSQ(B2:B6) = 55−66 = −11. This identity doesn’t establish equivalent text/blank/error handling on imperfect data.
Why this is different from squared error: SUMX2MY2 computes Σ(X²−Y²); SUMXMY2 computes Σ(X−Y)². With the same inputs the latter produces 5, not −11. The order of the two arguments matters for SUMX2MY2 because it contains subtraction.
More practical checks
- Swap the input ranges:
=SUMX2MY2(B2:B6,A2:A6)has expected result 11, the opposite sign. For fully numeric pairs, this is a quick audit of which series is the baseline. A negative original result means B’s sum of squares was larger; it does not mean each individual B measurement is larger. - A per-row audit: Put
=A2^2-B2^2in C2, fill it down to C6, then=SUM(C2:C6)(expected −11). This exposes row-level contributions and mis-entered values. For fully numeric data, reordering one column changes individual contributions but not the total difference of squared sums. - Difference-of-squares identity: For numeric cells,
A2^2-B2^2equals(A2-B2)*(A2+B2). This is useful when explaining why the magnitude of X²−Y² is affected by both the difference and the total size of a pair. The full-column cross-check is=SUMX2MY2(A2:A6,B2:B6)versus the sum of these five row-level products. - Comparing measurement intensity: If X and Y are quantities measured in the same physical units, this result has squared units, not the original units. Do not label the number as an average, a covariance, or a root-mean-square error.
Second deterministic case: Replace A2:A4 with 3,4,0 and B2:B4 with 4,0,0. For =SUMX2MY2(A2:A4,B2:B4), the expected calculation is (9−16)+(16−0)+(0−0)=9. This verifies that a legitimate numeric zero is not automatically a missing observation.
Limit of the reviewed documentation: The SUMX2MY2 manual entry gives its formula and compatibility classification but does not explicitly repeat the sibling functions’ note on unequal effective counts or nonnumeric cell treatment. Those edge cases are pending native validation—do not substitute assertions from another spreadsheet.
Source/manual discrepancy: The official 1.12.62 source archive was checksum-verified. All three functions use the same paired collector, ignoring range blanks, strings and Booleans. src/collect.c sends unequal collected lengths or no accepted pairs to the configured GNM_ERROR_VALUE fallback. The published sibling help instead says #N/A; this discrepancy remains a native-validation item, not a confirmed runtime-error promise.
Input hygiene and errors
- Array lengths: Use two equally sized ranges containing the same number of meaningful paired values. The official manual explicitly documents
#N/Afor different numbers of data points forSUMX2PY2andSUMXMY2; forSUMX2MY2it does not state that special case. Do not assume that a reference to rows 2–6 and a reference to rows 2–5 is valid. The precise mismatched-input error ofSUMX2MY2still requires native checking. - Text and blanks: The Gnumeric manual specifically says strings and empty cells are ignored for
SUMX2PY2andSUMXMY2. It does not separately specify that rule forSUMX2MY2. A skipped value could compromise pairing; the cross-row behavior for different distributions of blanks/text was not independently tested. Clean the data or explicitly form a pairwise numeric-only subset first, and don’t silently replace an absent measurement with zero. - Logical values, formula-generated errors, or numeric-looking text: Do not assume Excel, LibreOffice, or another application handles these identically. The documentation examined does not specify all of these cases for this function. Test such cases natively before making production claims, or normalize inputs to true numbers; a number stored as text is not a verified numeric measurement.
- Zeros and negatives: Real numeric zero is a valid observation for the stated arithmetic; negatives work algebraically but are squared where shown. Avoid entering thousands separators as if they were formula argument separators.
#NAME?or syntax errors: Check the English function spelling, closing parenthesis, correct pair of ranges, and the separator accepted by the installed locale; confirm the function is available in the installed Gnumeric release.- Unexpected totals: Verify that headers are excluded, ranges have the same orientation/order, values have not been sorted independently, and input columns truly contain numeric cells. Pair order changes SUMXMY2; for complete numeric columns, SUMX2MY2 and SUMX2PY2 depend only on the separate squared totals.
- Large-magnitude inputs: Squaring extremely large values can exceed floating-point range, and subtraction of similar large squares can lose precision. The published examples use small exact integers; overflow limits and the precise displayed error are not validated here.
Compatibility, related guides and verification boundaries
The Gnumeric Mathematics manual marks this function Microsoft Excel compatible, which is an upstream classification rather than independent Excel testing. Do not infer identical blank, text, Boolean, array-literal, locale, or file-import behavior from that label. The examples use Gnumeric’s documented English function name and ordinary cell-range references—not Excel-only features, array literals, macros, or screenshots. Version-specific test status: not executed natively in Gnumeric 1.12.62 or elsewhere. Only independent arithmetic and documentation review were performed.
Related Gnumeric guides: SUMSQ, SUMPRODUCT, SUMX2MY2, SUMX2PY2, SUMXMY2.
Official references and claim checks (accessed 2026-10-13 UTC)
- Gnumeric Mathematics manual, especially the
SUMX2MY2,SUMX2PY2, andSUMXMY2entries: official function category. This supports the exact two-argument syntax, mathematics, stated#N/Aand text/blank rules (where explicitly written), related functions, and the Excel-compatibility designation. - Gnumeric’s public function catalogue: GNOME-hosted catalogue. Lists each of the three functions as
CompletewithBasicupstream testing. Catalogue registration is not a local runtime test. - Gnumeric upstream version index: GNOME 1.12 source archives, indicating source release
1.12.62dated 2026-09-21. This is version evidence, not proof of tested runtime behavior.
Validation: All arithmetic examples independently checked; official documentation and checksum-verified1.12.62 function/collector source inspected. Native execution, screenshots, locale and workbook round-trip tests were not performed.