SUMXMY2 (sum of (x - y)^2)

<< Click to Display Table of Contents >>

SUMXMY2 (sum of (x - y)^2)

Syntax:

SUMXMY2(Range1, Range2)

Description:

Returns the sum of squares of differences of corresponding values in two arrays.

The equation for this function is:

SUMXMY2 = (x - y)^2

Range1 and Range2 are the arrays whose SumXMY2 is to be calculated. As a rule, the cell ranges in which the values are contained must be specified here.

Both ranges must have the same dimensions (height and width), otherwise the function returns a #N/A error value.

Pairs of values where at least one value is an empty cell or a non-numerical value (text string or logical value) are ignored.

Example:

Cells A1 to A3 contain the following values: 9, 4, 7

Cells B1 to B3 contain the following values: 1, 0, 5

If you calculate SUMXMY2(A1:A3, B1:B3) here, this is equivalent to the following calculation

(9-1)^2 + (4-0)^2 + (7-5)^2

The result is 84.

See also:

SUM, SUMPRODUCT, SUMX2MY2, SUMX2PY2, SUMSQ