Excel
SUMXMY2 function in Excel
Returns the sum of squares of differences of corresponding values in two arrays
=SUMXMY2(array_x, array_y)SUMXMY2 syntax and parameters
Two arguments, two required.
- array_xarrayRequired
- array_yarrayRequired
SUMXMY2 examples
Formulas you'll actually reuse.
Sum of squared differences — the core of a least-squares fit:
=SUMXMY2(B2:B50, C2:C50)Result
58240Root-mean-square error between forecast and actual:
=SQRT(SUMXMY2(B2:B50, C2:C50) / ROWS(B2:B50))Result
34.5
SUMXMY2 in Google Sheets
Same name — your formula ports as-is.
Try SUMXMY2 in the playground
Edit the example — nothing to install.
Preloaded with the SUMXMY2 formula from Example 1 — change anything and watch it respond.
Loading the editor…
SUMXMY2 errors
What they mean — and the fixes.
#N/AThe two arrays have different numbers of values.
Related functions
More ways Excel gets this done.
- ABSReturns the absolute value of a numberMathGoogle Sheets
- ACOSReturns the arccosine of a numberMathGoogle Sheets
- ACOSHReturns the inverse hyperbolic cosine of a numberMathGoogle Sheets
- ACOTReturns the arccotangent of a numberMathGoogle Sheets
- ACOTHReturns the hyperbolic arccotangent of a numberMathGoogle Sheets
- AGGREGATEReturns an aggregate in a list or databaseMathNo Google Sheets equivalent