SUMX2PY2 Function

Excel Functions › Math & Trig

All versions Math & Trig

The Excel SUMX2PY2 function returns the sum of the sum of squares — for each matched pair it computes x² + y² and adds the results, a common term in statistical formulas.


Quick answer:
=SUMX2PY2({2,3},{1,2}) = (4+1) + (9+4) = 18

Syntax

=SUMX2PY2(array_x, array_y)
ArgumentDescription
array_xRequiredThe first array or range of values (the x values).
array_yRequiredThe second array or range, same size as array_x (the y values).

How to use it

SUMX2PY2 adds the squares of every pair: it totals x² + y² across the two arrays, which must be the same size.

=SUMX2PY2({2,3},{1,2}) // (4+1)+(9+4) = 18
=SUMX2PY2({1,1},{1,1}) // (1+1)+(1+1) = 4

The name reads as X-squared Plus Y-squared. It is equivalent to SUMSQ(array_x) + SUMSQ(array_y) and appears in least-squares and other statistical derivations.

Try it: interactive demo

Live demo

Pick a SUMX2PY2 example to see the formula and its result.

Result:

Practice workbook

📊
Download the free SUMX2PY2 practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

What does SUMX2PY2 calculate?
It sums x² + y² over every pair. SUMX2PY2({2,3},{1,2}) = (4+1) + (9+4) = 18.
Is SUMX2PY2 the same as adding two SUMSQ results?
Yes — SUMX2PY2(x,y) equals SUMSQ(x) + SUMSQ(y). The dedicated function just saves a step in statistical formulas.
Must both arrays be the same size?
Yes. Mismatched array lengths return a #N/A error.
When would I use SUMX2PY2?
It shows up in regression and least-squares math where the sum of squared magnitudes across two variables is needed.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: SUMX2MY2 · SUMXMY2 · SUMSQ · SUMPRODUCT · SUM