Google Sheets SUMSQ Function: Syntax, Examples & Tips

Returns the sum of the squares of a series of numbers and/or cells.
Google Sheets
=SUMSQ(value1, [value2, ...])

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

On this page
  1. Parameters
  2. What Is SUMSQ?
  3. How SUMSQ Works
  4. Basic Examples
  5. Statistical Uses
  6. Common Use Cases
  7. Common Errors
  8. Tips and Best Practices
  9. Related Functions
  10. Example use case

Parameters

ParameterRequiredDescription
value1YesThe first number or range whose values will be squared and added.
value2, ...NoAdditional numbers or ranges to include.

What Is SUMSQ?

SUMSQ squares each number you give it and then adds those squares together. =SUMSQ(3, 4) returns 25, because 3² + 4² = 9 + 16. It accepts individual numbers, cell references and whole ranges, so =SUMSQ(A2:A100) squares and totals every value in the range in one step.

How SUMSQ Works

For each numeric value in its arguments, SUMSQ multiplies the value by itself and adds the result to a running total. It is equivalent to:

Google Sheets
=SUMPRODUCT(A2:A100, A2:A100)

or

Google Sheets
=SUM(ARRAYFORMULA(A2:A100^2))

but shorter and clearer.

How SUMSQ treats different values

  • Numbers in ranges are squared and summed.
  • Blank cells and text inside a range are ignored.
  • Numbers typed directly as arguments are always included.
  • Negative numbers become positive when squared, so =SUMSQ(-3) returns 9.

Basic Examples

Sum of squares of a few numbers

Google Sheets
=SUMSQ(1, 2, 3)

Returns 14 (1 + 4 + 9).

Sum of squares of a range

Google Sheets
=SUMSQ(B2:B20)

Multiple ranges

Google Sheets
=SUMSQ(B2:B20, D2:D20)

Squares every number in both ranges and adds them all together.

Length of a vector (Euclidean norm)

Google Sheets
=SQRT(SUMSQ(B2:D2))

Returns the magnitude of a 3-dimensional vector stored in B2:D2 — for example, the straight-line distance from the origin.

Distance between two points

Google Sheets
=SQRT(SUMSQ(C2-A2, D2-B2))

With x1, y1 in A2:B2 and x2, y2 in C2:D2, this gives the distance between the points.

Statistical Uses

The sum of squares is a building block of many statistics:

  • Root mean square (RMS): =SQRT(SUMSQ(B2:B100)/COUNT(B2:B100))
  • Sum of squared errors between forecasts and actuals: =SUMXMY2(B2:B100, C2:C100) is the dedicated function, but SUMSQ works on a pre-computed error column.
  • Variance by hand: the squared deviations from the mean can be totalled with DEVSQ, which is SUMSQ applied after subtracting the mean.

Common Use Cases

  • Engineering and physics: Vector magnitudes, RMS voltage or current.
  • Forecast accuracy: Totalling squared residuals.
  • Geometry: Pythagorean distances.
  • Data science: Feature normalisation (L2 norm).

Common Errors

  • Unexpectedly small result: Numbers stored as text in a range are skipped silently. Convert them with VALUE or check with ISNUMBER.
  • #VALUE!: A text value that cannot be read as a number was typed directly as an argument (for example =SUMSQ("abc")).
  • Confusing SUMSQ with SUM squared: =SUMSQ(2, 3) is 13, while =POW(SUM(2, 3), 2) is 25. They are different calculations.
  • Error values in the range: Any #N/A or #DIV/0! inside the range makes SUMSQ return that error. Clean the range or use IFERROR upstream.

Tips and Best Practices

  • Use DEVSQ when you want squared deviations from the mean rather than raw squares.
  • Use SUMX2MY2, SUMX2PY2 and SUMXMY2 for paired-array variants.
  • Pair SUMSQ with SQRT for magnitudes and distances.
  • SUMSQ accepts up to many ranges at once, so there is no need to build helper columns of squared values.

POW, SQRT, SUMPRODUCT, DEVSQ, SUMXMY2, VAR, and STDEV.

Example use case

An engineer logging AC voltage samples in column B needs the RMS value. The formula =SQRT(SUMSQ(B2:B501)/COUNT(B2:B501)) squares every sample, averages the squares and takes the square root, giving the effective voltage in a single cell.

Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.