Math & Trig
SUMXMY2 Function in Excel
Returns the sum of squares of differences of corresponding values in two arrays.
Syntax
- =SUMXMY2(array_x, array_y)
Arguments
- array_x (required): First array
- array_y (required): Second array
Examples
- =SUMXMY2(A1:A3, B1:B3) - Sum of (x-y)² - Result: Sum value
SUMXMY2 in reporting workflows
- Use absolute references when copying formulas across rows.
- For conditional totals see [SUMIF](/functions/sumif/) and [SUMIFS](/functions/sumifs/).
- Filtered lists may need [SUBTOTAL](/functions/subtotal/) instead of SUM on visible cells only.
Common errors
- Arrays must be same size
Use cases
- Least squares
- Error calculation
- Statistics
Frequently asked questions
- What is the SUMXMY2 function in Excel? SUMXMY2 returns the sum of squares of differences of corresponding values in two arrays. The syntax is =SUMXMY2(array_x, array_y). Typical use cases include least squares, error calculation, statistics.
- How do I use the SUMXMY2 function? To use SUMXMY2, type =SUMXMY2( in a cell and provide the required arguments. Excel will show you the syntax and parameter hints as you type. Make sure to close the parentheses and press Enter to execute the function.
- What happens if SUMXMY2 encounters errors? If SUMXMY2 encounters invalid arguments or calculation errors, it may return error values like #VALUE!, #NUM!, or #DIV/0!. Check your input values and ensure they meet the function's requirements.
- Why is SUMXMY2 not working in my Excel? Common issues with SUMXMY2 include Arrays must be same size. Start by checking the syntax =SUMXMY2(array_x, array_y), then verify each referenced cell or range.
Editorial review
- Reviewed by Excel.Directory Editorial Team. Updated May 2026.