Contact

SUMX2PY2 Function in Apple Numbers: Add Two Sums of Squares

Numeric Intermediate Apple Numbers

Calculate the combined squared magnitude of two numeric data series with SUMX2PY2 in Apple Numbers, step by step.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Apple Numbers. How formula examples are checked

Quick answer: Use SUMX2PY2 to add the squares of corresponding values from two numeric collections and return one combined total. With Apple’s six-row example, =SUMX2PY2(A1:A6,B1:B6) is 640. The formula’s mathematical rule is Σ(Aᵢ² + Bᵢ²). That result is printed in Apple’s official function help and independently reproduced below; it has not been observed by running Numbers [A1, C1].

Exact Apple syntax and arguments

=SUMX2PY2(set-1-values, set-2-values)
Argument, in official order Required? Apple’s documented input type Role
set-1-values Yes Collection containing number values First dataset, paired in order with the second.
set-2-values Yes Collection containing number values Second dataset, paired in order with the first.

Both arguments appear as required in the documented Apple syntax; there is no documented default and no documented optional argument in this entry. They are collections: a contiguous numeric range such as A1:A6 is the clearest example. The expressions set-1-values and set-2-values are argument labels, not literal text to type into Numbers [A1].

What the function computes

For aligned values in A1:A6 and B1:B6, the mathematical operation is

SUMX2PY2(A1:A6, B1:B6) = Σ(Aᵢ² + Bᵢ²)

The first pair contributes 2² + 7² = 4 + 49 = 53. Each number is squared separately; the values are not added first and then squared. Apple’s documentation provides the function’s name, both typed inputs, and a worked example [A1]; the algebraic expansion is independently checked [C1].

Where the function works, and what was actually verified

This guide uses Apple’s English Formulas and Functions Help 15.4 and its numerical example, checked 2026-10-12. The help edition is a documentation version, not proof that the function first shipped in Numbers 15.4 or is available in every older Mac, iPad, iPhone or iCloud release. Apple publishes the function in its Numeric category [A1, A5]. The calculations below were independently evaluated in a separate arithmetic model; there was no native Apple Numbers formula execution and no screenshot or measured application output. For a particular device, verify the function appears in that installed app’s Function Browser before relying on it for production work [A1, A5].

Use a normal Numbers table (not an Excel-style sheet-only cell grid). If the formula and data are in one table, A1:A6 and B1:B6 refer to its first two columns. For references in another table, Apple’s documented form is Table 2::A1:A6; if a table name or header wording makes a reference ambiguous, use the reference picker and qualify the table or sheet [A3]. The examples use English function names and comma argument separators. In regions where the decimal separator is a comma, Apple requires semicolons between function arguments: e.g. =SUMX2PY2(A1:A6;B1:B6) [A2]. Function names are not case-sensitive [A2].

Why corresponding rows matter

These calculations pair the first numeric observation in the first collection with the first in the second collection, the second with the second, and so forth [A1]. Arrange observations in equal-length, corresponding rows before using the formula. Preserve paired rows when the observations are related. For these complete numeric inputs, rearranging one collection does not change the final total, because each collection is squared and summed separately. The official function page names both arguments as collections containing number values, and it does not document a numeric default or an optional third argument [A1]. It does not, by itself, establish a specific Numbers error code or coercion rule for unequal-size arrays, strings, dates, Boolean cells, or missing observations. Don’t substitute Excel’s separate validation rules as evidence for Numbers [A1, X1].

Reproduce Apple’s official six-row exercise

Create a single Numbers table with no header rows for this demonstration (alternatively, use six ordinary data rows beginning at row 1). Enter the following numbers exactly in A1:B6:

Row A B Pairwise add squares contribution
1 2 7 53
2 9 5 106
3 3 6 45
4 11 8 185
5 1 12 145
6 5 9 106
  1. Select a blank cell outside A1:B6 (for example D1).
  2. Enter =SUMX2PY2(A1:A6,B1:B6). The ordinary English-locale formula uses a comma between collection references [A1, A2].
  3. The expected result from Apple’s own example is 640 [A1]. The pairwise calculations above independently reproduce this total [C1].
  4. As a cross-check, inspect the per-row calculations. Do not enter a result formula inside A1:B6, because doing so would overwrite an input or create a circular dependency.

This fixture has 241 as the sum of A’s squares, 399 as the sum of B’s squares, and 222 as the A×B sum of products. The aligned pairs were independently calculated using integer arithmetic, not by running the Numbers formula [C1]. An equivalent independent mathematical check is SUMSQ(A1:A6) + SUMSQ(B1:B6); for this fixture it yields 640 [C1, A4].

Three small diagnostic worksheets (independent expected outputs)

Each test uses a separate table with exactly the rows shown, no header row, and one formula in a blank cell outside A:B. The right-hand output is an expected mathematical result, not an observed Apple Numbers output [C2].

Test setup (A ; B by rows) Example formula Expected result Why it matters
A=[1,2,3]; B=[4,5,6] =SUMX2PY2(A1:A3,B1:B3) 91 Checks sign/operation using three familiar pairs.
A=[1,0,−2]; B=[0,−2,3] =SUMX2PY2(A1:A3,B1:B3) 18 Checks a zero and negative numbers mathematically.
A=[2,9,3,11,1,5]; B=[7,5,6,8,12,9] =SUMX2PY2(A1:A6,B1:B6) 640 Repeats Apple’s published worked fixture.

For the second test, type the minus sign as a normal keyboard hyphen when entering negative numbers in Numbers. It is a calculated arithmetic test only; Apple’s single-paragraph function entry does not separately give all negative-number and zero-value corner cases [A1, C2].

Advanced example: total squared magnitude of paired measurements

For a three-row numeric table:

Row A: East component B: North component A² + B²
1 1 4 17
2 2 5 29
3 3 6 45

Enter =SUMX2PY2(A1:A3,B1:B3) in an unused cell. The expected result is 91; it is the combined sum of all six squared components, not the sum of the individual Euclidean lengths [C2]. Swapping the collections still produces 91 because addition is commutative [C2].

For two-dimensional components measured in compatible units, the expression is the sum of squared lengths, not a length. Its unit is the square of the input unit. To get the root of the total sum, use =SQRT(SUMX2PY2(A1:A3,B1:B3)); the independently calculated expected value is about 9.539392014 [C2]. This is not the sum of per-row square roots; those are different operations.

Cross-check without a paired special function

Because every term is Aᵢ² + Bᵢ², SUMX2PY2(A,B) is mathematically equal to SUMSQ(A)+SUMSQ(B) for the same numeric data. In Apple’s six-row fixture, the two separate sums are 241 and 399, giving 640 [A1, A4, C1]. Do not replace it with SUMSQ(A+B); (a+b)² includes an additional 2ab term [C3].

Errors, limitations, and troubleshooting

Result differs from the table above. Confirm that the six exact input pairs are present, each column contains real numeric values (not numbers imported as text), and the formula is placed outside the input range. With a header row, the data begin at row 2, so adjust both range ends together (e.g. A2:A7 with B2:B7) [A1, A3].

Sorting and pairings. Sorting one column changes the row pairings but not this total for complete numeric inputs: the operation combines the two separate sums of squares. Preserve matched rows for other paired analyses, especially SUMXMY2, where pairing does affect the result [C3].

Input ranges have unequal lengths. Align the collections before evaluating; don’t pad one series with invented zeros or silently drop unmatched records. Microsoft’s Excel reference documents a specific unequal-length error, but the current short Apple help article does not specify the corresponding Numbers error token. We therefore do not claim a particular Numbers error code [A1, X1].

Blank, text, Boolean, date, and duration cells. Apple documents number values in both collections, not a complete coercion/ignore matrix. Clean and validate such inputs, and run controlled Numbers-native tests on the target release before relying on special handling. In particular, don’t transfer Excel’s blank or Boolean handling rules into a Numbers guide as though Apple had stated them [A1, X1].

Wrong calculation despite valid numeric data. If your result is larger than you expected, check whether you meant the squared distance between observations. SUMX2PY2 adds the squares; SUMXMY2 squares the differences. An inadvertent plus sign in an intended subtraction changes the measure. Check whether your application should measure change in total squared magnitudes, combined magnitude, or paired prediction error—these are three different questions [A1, A4].

Very large or very small numbers. Squaring scales values rapidly. Check that input magnitudes and units are appropriate; precision/range limits and underflow/overflow behavior are not quantified by this Apple help page. Verify against high-precision independent arithmetic when accuracy matters. This is a mathematical caution, not a claim that Numbers returns a specific overflow error [C3].

Excel and other spreadsheet compatibility

Excel supports the same English function name and the same sum-of-squared-components interpretation [X1]. Excel also documents particular behavior for blanks, text, logical values, zero and mismatched lengths, but those specifics are Excel documentation only unless independently checked in Numbers [A1, X1].

Excel’s English names and operand order match this mathematical operation for numeric aligned ranges. Do not infer that Google Sheets, LibreOffice, WPS, Gnumeric, or other apps implement identical coercion, array behavior, localization, and version support without separately checking their vendor documentation. This guide’s example outputs are platform-independent mathematical predictions, not a cross-application execution report [A1, X1].

For decimal-comma locales in Numbers, the example becomes =SUMX2PY2(A1:A6;B1:B6) [A2]. In localized Excel, translated function names and punctuation may differ; Microsoft’s English help page is not evidence of a locale-independent name [X1].

  • Apple: SUMSQ squares numeric values in one or more collections; it supports the independent identities above [A4].
  • Apple: SUMPRODUCT computes aligned products and provides an independent check on paired squared differences [A4].
  • Apple: SUMX2MY2 subtracts the squares first and then sums. [A4]
  • Apple: SUMX2PY2 adds corresponding squares. [A4]
  • Apple: SUMXMY2 squares corresponding differences. [A4]

Claim-level official sources and evidence ledger

[A1] Apple, SUMX2PY2, English Formulas and Functions Help, version 15.4; accessed 2026-10-12. Supports function name, required argument order/types, purpose, and six-row example/expected result; does not establish native test outcomes, exact version introduced, or undocumented corner-case behavior.

[A2] Apple, Functions overview, accessed 2026-10-12. Supports required/optional argument notation, comma-versus-semicolon locale rule, and case-insensitive function names.

[A3] Apple, Refer to cells in formulas, accessed 2026-10-12. Supports Numbers table range notation, cross-table :: references, and header-related reference behavior.

[A4] Apple, SUMSQ, SUMPRODUCT, and other members of the SUMX family, accessed 2026-10-12. Supports existence and function names. The algebraic identities and calculated example totals are independently proven in [C1–C3], not asserted as verbatim Apple descriptions.

[A5] Apple, List of functions by category, checked 2026-10-12. Supports inclusion in the current official Numeric functions list. Does not prove minimum Numbers release availability.

[X1] Microsoft, SUMX2PY2 for Excel, accessed 2026-10-12. Used only to check the English Excel counterpart; any Excel-specific error/coercion rules are explicitly not attributed to Numbers.

[C1] Independent integer calculation, 2026-10-12: test fixture A=(2,9,3,11,1,5), B=(7,5,6,8,12,9); sum of A²=241; sum of B²=399; sum of products A·B=222; SUMX2PY2 expected 640. Cross-checked with Apple’s published result [A1]. Method: Python integer arithmetic, not Apple Numbers execution.

[C2] Independent integer calculation, 2026-10-12: A=(1,2,3), B=(4,5,6) yields 91; A=(1,0,−2), B=(0,−2,3) yields 18. Method: Python integer arithmetic, not Apple Numbers execution.

[C3] Elementary algebra and matched-observation reasoning. Its conclusions can be verified symbolically; no platform test or benchmark is claimed.

Native-validation limitations

Unequal lengths, numeric-looking text, blanks, Boolean inputs and header behavior were not tested in an installed Numbers release. Verify relevant edge cases on your target device and locale before depending on them.