SUMX2MY2 Function

Excel 2007+

Summary

The SUMX2MY2 function calculates the sum of the difference of squares between corresponding values in two arrays. It computes Σ(x² - y²) for each pair of values, providing a mathematical shortcut for analyzing differences between datasets.

Syntax

SUMX2MY2(array_x, array_y)

Parameters

Parameter Type Required Description
array_x Array/Range Yes The first array or range of numeric values
array_y Array/Range Yes The second array or range of numeric values

Using the SUMX2MY2 Function

SUMX2MY2 efficiently computes the sum of squared differences between two datasets without intermediate calculations. It's particularly useful in statistical analysis, regression diagnostics, and when comparing magnitude differences between paired observations across equal-sized arrays.

Common SUMX2MY2 Examples

Range-based Calculation

=SUMX2MY2(A2:A8,B2:B8)

Calculates sum of difference of squares for two vertical ranges containing 7 values each. Returns -55.

Array Constants

=SUMX2MY2({2,3,9,1,8,7,5},{6,5,11,7,5,4,4})

Direct array calculation yielding the same result of -55 without referencing cells.

Frequently Asked Questions

#N/A error is returned. Both arrays must contain exactly the same number of values.

Yes, cells containing zero are included, unlike text, logical values, or empty cells which are ignored.

It calculates Σ(array_x[i]² - array_y[i]²) for corresponding pairs.

Common Errors and Solutions

#N/A Error

Cause: Arrays have unequal number of elements

Solution: Ensure both arrays contain identical count of values

#VALUE! Error

Cause: Arguments contain incompatible data types

Solution: Use only numeric values, ranges, or array constants

Notes

  • Equivalent to SUMX2PY2(array_x,array_x) - SUMX2PY2(array_y,array_y)
  • Perfect for statistical applications like ANOVA calculations
  • Processes arrays element-by-element pairwise
  • Available since Excel 2007

Compatibility

Available in: Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Microsoft 365

Not available in: Excel 2003, Excel XP, Excel 2000, Excel 97

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+