SUMX2MY2: Pairwise Square Difference Totals in WPS Spreadsheet
Calculate the sum of x squared minus y squared with SUMX2MY2. Follow aligned numeric examples, zero handling and documented size errors.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
SUMX2MY2 pairs two numeric arrays, squares the corresponding values separately, then totals their difference. Its mathematical operation is the sum of x² − y². The order of squaring and combining matters: this is not the sum of squared differences (x−y)².
Syntax and paired inputs
=SUMX2MY2(array_x, array_y)
Both inputs are required. The lesson permits numbers, arrays, names and references. For a transparent worksheet example, use two equal-length numeric columns with each intended pair on the same row. The cited lesson explicitly documents #N/A when the element counts differ. That is a documented error expectation, not an observed WPS execution in this guide.
Enter a complete three-pair example
| Cell row | A: x | B: y | x² | y² | x² − y² |
|---|---|---|---|---|---|
| 2 | 3 | 1 | 9 | 1 | 8 |
| 3 | 4 | 2 | 16 | 4 | 12 |
| 4 | 0 | 5 | 0 | 25 | −25 |
Enter =SUMX2MY2(A2:A4,B2:B4). The independently expected answer is -5, from 8+12−25. Numeric zero participates: its pair with 5 contributes −25, rather than disappearing as though the row were blank.
Additional controls with complete values
Each row below is a separate replacement dataset. Enter its x list down A2 and its y list down B2, then use the matching ranges. Do not combine the lists into one longer calculation.
| x values | y values | Expected result |
|---|---|---|
| [3, 4, 0] | [1, 2, 5] | -5 |
| [-3, 4] | [1, -2] | 20 |
| [0, 0] | [3, 4] | -25 |
| [2] | [2] | 0 |
| [1.5, 2] | [0.5, 1] | 5.0 |
| [1, 2] | [3, 4] | -20 |
Negative inputs are squared before combination, so their signs disappear within the individual squares. The fractional control uses 1.5²=2.25 and 0.5²=0.25; the arithmetic follows exactly from the supplied values.
Practical interpretation: compare two squared magnitudes
For the main example, the x squares total 25 and the y squares total 30. Their difference is −5. Swapping the two arrays changes the sign to +5. A zero result would mean equal totals of squares, not necessarily equal measurements row by row.
This is why SUMX2MY2 should not be used as a nonnegative distance or residual-error score. The squared differences for the main example would instead be 4+4+25=33. That is a different mathematical calculation, associated with SUMXMY2 rather than this function. Cancellation can make a difference of square totals small even when individual pairs differ substantially.
Missing values, errors and safe use
The official lesson says text, logical values and blanks in array or reference arguments are ignored, while zero is included. It does not explain every mixed-type pairing or compaction detail. Consequently the worked controls use fully numeric aligned ranges; do not silently remove missing entries from only one side and assume the remaining observations still form the intended pairs.
For the documented size-error control, set A2:A3 to 1, 2 and B2:B4 to 3, 4, 5. Supplying those ranges has two versus three elements and the lesson specifies #N/A. Other error propagation and direct-scalar coercion details are not inferred from Excel.
Keep units consistent, verify both endpoints and inspect outliers before squaring. Large values can dominate a squared total. The source does not provide a numerical precision or overflow guarantee; the small examples here are independent arithmetic checks, not a certification of large-scale numerical behavior.
Availability and evidence
The official WPS lesson is dated 2019-06-25 and explicitly labels its applicability WPS Office for Windows Personal. It does not identify a numeric release. This establishes documentation by that date, not the function’s original introduction or its last working version. Current build limits and equivalence across WPS clients remain unverified. The available evidence does not establish retirement or formal deprecation.
Checked October 18, 2026. The examples in this guide are original, independently calculated controls based on the lesson. They have not been run in WPS or another spreadsheet application. No screenshot or execution result is claimed.