Exceljet

Quick, clean, and to the point

Excel SUMXMY2 Function

Excel SUMXMY2 function
Summary 

The Excel SUMXMY2 function returns the sum of squares of differences between corresponding values in two arrays. Values can be supplied as constants, cell references, or ranges.

Purpose 
Sum of squares of differences in two arrays
Return value 
Calculated sum of squares of differences
Syntax 
=SUMXMY2 (array_x, array_y)
Arguments 
  • array_x - The first range or array containing numeric values.
  • array_y - The second range or array containing numeric values.
Version 
Usage notes 

The Excel SUMXMY2 function returns the sum of squares of differences between corresponding values in two arrays.The "m" in the function name stands for "minus", as in "sum x minus y". SUMXMY2 can accept values as constants, references or ranges.

Examples

=SUMXMY2({0,1},{1,2})// returns 2
=SUMXMY2({1,2,3},{1,2,3}) // returns 0

In the example shown above, the formula in E5 is:

=SUMXMY2(B5:B12,C5:C12)

which returns 28 as a result.

Equation

The equation used to calculate the sum of the sum of squares is:

 

This formula can be created manually in Excel with the exponentiation operator (^) like this:

=SUM((range1-range2)^2)

With the example as shown, the formula below will return the same result as SUMX2MY2:

=SUM((B5:B12-C5:C12)^2) // returns 28

Notes

  • Arguments can any mix of constants, names, arrays, or references that contain numbers.
  • Text values are ignored, but cells with zero values are included.
  • SUMXMY2 returns #N/A if the arrays contain different numbers of cells.

Download 200+ Excel Shortcuts

Get over 200 Excel shortcuts for Windows and Mac in one handy PDF.