All versions
Math & Trig
The Excel SUMX2MY2 function returns the sum of the difference of squares — for each matched pair it computes x² − y² and adds the results. Used in regression and engineering formulas.
Quick answer:
=SUMX2MY2({2,3},{1,2}) = (4-1) + (9-4) = 8
Syntax
=SUMX2MY2(array_x, array_y)
| Argument | Description | |
|---|---|---|
array_x | Required | The first array or range of values (the x values). |
array_y | Required | The second array or range, same size as array_x (the y values). |
How to use it
SUMX2MY2 walks both arrays in parallel and sums x² − y² for each pair. The two arrays must be the same size.
=SUMX2MY2({2,3},{1,2}) // (4-1)+(9-4) = 8
=SUMX2MY2({5,4},{3,2}) // (25-9)+(16-4) = 28
The “X2MY2” in the name reads as X-squared Minus Y-squared. Its siblings are SUMX2PY2 (sum of the sum of squares) and SUMXMY2 (sum of squared differences).
Try it: interactive demo
Live demo
Pick a SUMX2MY2 example to see the formula and its result.
Result:
Practice workbook
Download the free SUMX2MY2 practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.
Frequently asked questions
What does SUMX2MY2 compute?
For each matched pair it works out x² − y² and adds the results.
SUMX2MY2({2,3},{1,2}) = (4−1) + (9−4) = 8.How do I read the function name?
X2MY2 = X-squared Minus Y-squared. So it sums (x² − y²) over every pair of values.
Must the two arrays be the same size?
Yes. If
array_x and array_y differ in length, the function returns a #N/A error.How is it different from SUMXMY2?
SUMX2MY2 sums (x² − y²); SUMXMY2 sums (x − y)², the squared differences. The math and the results are quite different.
Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class