# SUMX2MY2 Function

> Return the sum of the differences of squares of two arrays with SUMX2MY2 in TX Sheet Control: how pairs are calculated, #VALUE! and a worked example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > Formula Functions > SUMX2MY2 Function
- **197 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/sumx2my2/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/sumx2my2/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/sumx2my2/llms-full.txt

---

Return the sum of the differences of the squares of corresponding values in two arrays. For each pair of values, SUMX2MY2 subtracts the square of the value in `array2` from the square of the value in `array1`, and adds the differences. Arrays of different sizes return `#VALUE!`.

### Syntax

```text
SUMX2MY2(array1, array2)
```

Category: Math. Minimum arguments: 2. Maximum arguments: 2.

Available for supported offline calculation.

### Examples

```text
=SUMX2MY2({1,2},{3,4})
```

The formula returns -20, which is (1² − 3²) + (2² − 4²).

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

### See Also

- [Formulas](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formulas/llms-full.txt)
- [Custom Functions and Formula Data](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/custom-functions/llms-full.txt)

---

## Nearby

- **Previous:** [SUMSQ Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/sumsq/llms-full.txt)
- **Next:** [SUMX2PY2 Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/sumx2py2/llms-full.txt)
