The `SUMXMY2` function in Google Sheets is a powerful tool for performing statistical analysis. It computes the sum of the squares of the differences between two arrays of numbers, making it particularly useful in various mathematical applications, including regression analysis and statistical modeling. By quantifying how much values deviate from one another, this function provides critical insight into data variability.
Syntax
SUMXMY2(array_x, array_y)
- array_x: The first array of numerical data.
- array_y: The second array of numerical data.
Example #1
SUMXMY2(A1:A5, B1:B5)
This calculates the sum of the squares of the differences between values in the range A1:A5 and B1:B5. For example, if A1:A5 holds values {1, 2, 3, 4, 5} and B1:B5 holds {2, 3, 4, 5, 6}, the result would be 25.
Example #2
SUMXMY2({3, 5, 2}, {1, 2, 8})
Here, it computes the sum of the squares of the differences between the arrays {3, 5, 2} and {1, 2, 8}. The result would be 38, derived from (3-1)² + (5-2)² + (2-8)².
Example #3
SUMXMY2(D1:D10, E1:E10)
In this case, the function evaluates the differences for the ranges D1:D10 and E1:E10. Assuming D1:D10 contains values {4, 6, 8} and E1:E10 has {1, 3, 5}, it would yield a result of 38.
Error handling
- N/A: This error occurs when the sizes of the two arrays are not the same.
- VALUE: Indicates that one or both of the inputs are not valid, such as a string instead of a number.
- REF: Shows up when a referenced cell has been deleted or is invalid.