SUMX2MY2 Function

Returns the sum of the differences of squares of two arrays (Σ x² − y²).

Category

Math & Trig

Available in

All versions, Microsoft 365

Returns

A number

Want to practice SUMX2MY2 in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox

Overview

SUMX2MY2 squares each pair of matching values, subtracts the second square from the first, and adds the results.

It's mainly found in statistics and engineering formulas.

Syntax

=SUMX2MY2(array_x, array_y) Explain

Arguments

ArgumentRequired?What it does
array_xYesThe first range.
array_yYesThe second range, same size.

Examples

Example 1 — x² − y² for each pair

(2² − 1²) + (3² − 2²) + (4² − 3²).

C2fx=SUMX2MY2(A2:A4, B2:B4)
ABC
1xyResult
22115
332
443
=SUMX2MY2(A2:A4, B2:B4) Explain

Common mistakes

  • Different sizes. Return #N/A.

Notes

  • Same as =SUMPRODUCT(A2:A4^2 - B2:B4^2).
  • Related functions: SUMX2PY2, SUMXMY2, SUMSQ.
Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.