Contact

SUMSQ Function (LibreOffice Calc)

Math Beginner LibreOffice Calc

Use LibreOffice SUMSQ with multiple numbers and ranges. Calculate residual error and vector length, audit text and logical cells, and distinguish sum of squares from squared sum.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: SUMSQ squares each included number and adds those squares. It accepts multiple values or ranges and does not square their combined sum.

Availability and version history

  • Introduced: Documented by LibreOffice 26.8.1.1; original introduction not established.
  • Availability: Supported in LibreOffice 26.8.1.1, verified against its function registry. This identifies a supported release, not a final working version.
  • Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
  • Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.

The SUMSQ function in LibreOffice Calc is used for this task: Returns the sum of the squares of the arguments. Square the values and add the squares.

This guide explains how to read the formula, reproduce a concrete example, interpret its result and recognize common input mistakes.

Syntax and arguments

SUMSQ(Number1 [; Number2 [; ... [; Number255]]])
Argument Required? Meaning
Number1 Yes First numeric value, cell reference or range to square and sum.
Number2 … Number255 No Additional numeric values, cell references or ranges.

Calc formulas normally use semicolons (;) between arguments in common configurations; the displayed separator may depend on settings or locale.

Worked example

=SUMSQ(3;4)

Expected result: 25.

Why it works: Square the values and add the squares.

How to use it in your own spreadsheet

  1. Identify the cells or inputs that correspond to the sample values above.
  2. Enter the formula in an empty cell, changing the references or literal values to match your sheet.
  3. Compare the output with a manual check on a small known example.
  4. Extend the formula to a larger dataset only after you understand the result.

Common problems and practical checks

  • Check the accepted numeric domain, units and array dimensions for the specific operation.
  • If an error appears, check that the function arguments are of the expected type.
  • A pasted formula may produce an error when it uses the other program’s argument separator or unsupported options.

Additional worked application and edge cases

Complete argument contract

Number1 is required; Number2 through Number255 are optional. Each argument can be a number, a cell reference or a range. A range counts as one argument even if it contains more than 255 cells. There is no optional switch for a population/sample denominator: SUMSQ simply adds the squared numeric values it receives.

Negative values are allowed and contribute positive squares. Zero contributes zero. The result is different from squaring the sum: SUMSQ(3;4) is 25, while (3+4)^2 is 49.

Stepwise example: compare observed and predicted values

Enter this small synthetic dataset:

Row A: observed B: predicted C: residual
2 10 11 -1
3 15 13 2
4 12 12 0
5 9 10 -1

Calculate C2 with =A2-B2 and fill down to C5. Then enter =SUMSQ(C2:C5) in E2. The independently expected result is 6, because 1+4+0+1=6.

By contrast, =SUM(C2:C5)^2 gives 0 because the signed residuals cancel before squaring. This is why a sum of squares can measure overall deviation even when average signed error is zero. Squaring also weights a large deviation more heavily than a small one.

Advanced application: norm and root-mean-square error

For the same complete numeric residual range, =SQRT(SUMSQ(C2:C5)) gives the Euclidean length, approximately 2.4494897428. =SQRT(SUMSQ(C2:C5)/COUNT(C2:C5)) gives the root-mean-square residual, approximately 1.2247448714. The latter divides by four observations before taking the square root.

These formulas answer different questions. SUMSQ alone has squared units; the two square-root results return to the residuals’ unit. Neither expression automatically calculates sample variance, estimates degrees of freedom, or proves a model is appropriate. Keep the denominator aligned with the intended definition and validate missing or nonnumeric observations first.

Mixed-cell example: what participates in Calc

On another sheet, set A2 to 3, A3 to -4, A4 to the text string 5 (enter '5 to retain text), leave A5 genuinely empty, enter =TRUE() in A6, =FALSE() in A7 and ="" in A8.

The source-derived expected result of =SUMSQ(A2:A8) is 26: 3 squared plus -4 squared plus 1 squared plus 0 squared. The referenced text and empty entries are ignored. Adding a numeric argument with =SUMSQ(A2:A8;2) gives 30.

Calc treats numeric/logical cells as numbers here, so a TRUE flag can add one. Do not import another application’s logical-value rules. Keep flags and status labels outside a measurement range unless their inclusion is deliberate.

Empty ranges, direct strings and errors

With no numeric contributions and no errors in a referenced range, the sum starts and remains at zero. That zero does not prove that every residual was measured and happened to be zero. Inspect the valid-observation count as well.

The range-text rule is not a promise that a literal string argument is ignored. A direct nonnumeric string such as =SUMSQ("pending";3) is invalid in the reviewed implementation. Convert intentional numeric imports explicitly instead of silently replacing all text with zero. Error values in the input can propagate; ordinary SUMSQ does not suppress them.

Very large magnitudes can overflow when squared, even if the unsquared inputs fit in the numeric range. Review scaling and units when that happens. The aggregation and input-type behavior above are supported by ScSumSQ and IterateParameters in the versioned Calc source. The source tag is not evidence of a new application run.

Verification scope for this addition: These added results were independently calculated or derived from the cited documentation/source. They were not newly tested in LibreOffice Calc. The original example-specific Calc 25.2.3.2 claims elsewhere on this page remain historical and apply only to those original examples. The cited 26.8.1.1 source tag is a code reference, not a claim of a new run in that release.

Documentation and verification

  • LibreOffice Calc Help
  • The standalone example was calculated using LibreOffice Calc 25.2.3.2 on October 9, 2026 and its computed result matched the expected value. This does not certify every option, version, or other example.

Detailed reference checked October 17, 2026