SUMSQ returns the sum of the squares of the numbers you give it. It squares each value and adds the results, saving you from writing a separate multiplication for every number.
=SUMSQ(number1, [number2], …)What does SUMSQ do?
SUMSQ is a Math & Trig function that takes one or more numbers, squares each one, and then adds all those squared values together. Instead of writing =A2^2+B2^2+C2^2, you can write =SUMSQ(A2:C2) and get the same result in a single step. It accepts individual numbers, cell references, ranges, and even arrays.
This matters because squaring values before adding them is common in statistics, engineering, finance, and quality control. Measures like variance, standard deviation, root mean square, and distance calculations all start with a sum of squares. Doing that by hand is slow and easy to get wrong, especially when a range contains dozens of rows.
Imagine you are checking the accuracy of a batch of measurements. You have a list of errors, some positive and some negative, and you want to know the total squared error. With SUMSQ you select the error column and get the answer instantly. The same approach works for sales variances, test scores, or any list of numbers where the size of each value matters more than its sign.
When to use SUMSQ
- Calculating total squared error or deviation in a quality check.
- Finding the sum of squares for variance or standard deviation work.
- Computing root mean square (RMS) values in engineering or physics.
- Adding squared distances or magnitudes in geometry and data analysis.
- Aggregating squared sales variances or budget differences.
- Preparing inputs for regression or ANOVA calculations.
SUMSQ syntax
=SUMSQ(number1, [number2], …)| Argument | Required? | What to enter |
|---|---|---|
number1 | Required | The first number, cell reference, or range to square and add. Example: A2:A10 or 5. |
number2 | Optional | Additional numbers, references, or ranges. You can supply up to 255 arguments in total. Example: B2:B10. |
What it returns: A single number: the sum of the squares of all numeric values supplied. Text, logical values, and empty cells inside ranges are ignored; direct logical values and text numbers typed as arguments are counted.
SUMSQ examples
1 Sum of squares for a short list of numbers
The goal is to square three values and add the results. SUMSQ takes the range B2:B4, squares 3, 4, and 5 to get 9, 16, and 25, then adds them. The total is 50, which appears in cell D2.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Item | Value | |||
| 2 | First | 3 | 50 | ||
| 3 | Second | 4 | |||
| 4 | Third | 5 | |||
| 5 |
2 Total squared error in a quality check
A production team records the difference between measured and target weight for five units. Negative and positive errors should not cancel out, so each error is squared first. SUMSQ on C2:C6 squares each error and adds them, giving 0.35. This shows the overall size of the error regardless of direction.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Unit | Target | Error | |||
| 2 | U1 | 100 | 0.2 | 0.39 | ||
| 3 | U2 | 100 | -0.3 | |||
| 4 | U3 | 100 | 0.1 | |||
| 5 | U4 | 100 | 0.4 | |||
| 6 | U5 | 100 | -0.3 | |||
| 7 |
3 Sum of squares across two columns
A student has quiz scores in two columns and wants the sum of squares for all scores. SUMSQ accepts both ranges separated by a comma. It squares every score in B2:B4 and C2:C4 and adds all six results. The answer is 1,394.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Student | Quiz 1 | Quiz 2 | |||
| 2 | Ana | 10 | 12 | 1214 | ||
| 3 | Ben | 14 | 15 | |||
| 4 | Cara | 18 | 15 | |||
| 5 |
4 Squared sales variances by region
A sales manager compares actual sales with the forecast for four regions. The variance column shows the difference. SUMSQ on D2:D5 squares each variance and adds them, producing 2,500. That figure feeds into a larger variance report without needing helper columns.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Region | Forecast | Actual | Variance | |||
| 2 | North | 1200 | 1250 | 50 | 4300 | ||
| 3 | South | 900 | 870 | -30 | |||
| 4 | East | 1100 | 1130 | 30 | |||
| 5 | West | 800 | 800 | 0 | |||
| 6 |
5 Root mean square from squared values
An engineer has five current readings and wants the sum of squares as a first step toward RMS. SUMSQ on B2:B6 squares each reading and adds them. The result, 1,350, can then be divided by the count and square-rooted to finish the RMS calculation.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Reading | Current (A) | |||
| 2 | R1 | 10 | 990 | ||
| 3 | R2 | 12 | |||
| 4 | R3 | 15 | |||
| 5 | R4 | 20 | |||
| 6 | R5 | 11 | |||
| 7 |
Common SUMSQ errors and how to fix them
| Error | Why it happens | How to fix it |
|---|---|---|
| #VALUE! | An argument is text that cannot be converted to a number, such as a word typed directly into the formula. | Remove or correct the text argument, or reference a cell that contains a number. |
| #NUM! | A result is too large for Excel to display, often after squaring extremely large numbers. | Check the input values for unrealistic magnitudes and reduce them or split the calculation. |
| #NAME? | The function name is misspelled, for example =SUMSQR(...). | Type =SUMSQ( and let Excel suggest the correct name, or correct the spelling. |
| Wrong total | A range includes text numbers stored as text, which SUMSQ ignores inside ranges. | Convert text numbers to real numbers with Text to Columns or by multiplying by 1. |
Tips for using SUMSQ
- Use SUMSQ instead of writing
=A2^2+B2^2for each row; it is shorter and less error-prone. - Remember that SUMSQ ignores text and empty cells inside ranges, so clean data first if totals look low.
- Combine SUMSQ with
COUNTto calculate variance:=SUMSQ(range)/COUNT(range)gives the mean of squares. - For RMS, wrap SUMSQ in a square root and divide by the count:
=SQRT(SUMSQ(range)/COUNT(range)). - Use whole-column references only when necessary; limiting ranges keeps formulas fast in large workbooks.
- Test with a small range first to confirm that negative values are being squared as expected.
Frequently asked questions
What is the difference between SUMSQ and SUMPRODUCT?
SUMSQ squares each number and adds the results. SUMPRODUCT multiplies corresponding values in two or more arrays and then adds those products. Use SUMSQ when you only need squares of a single list.
Does SUMSQ work with negative numbers?
Yes. Each negative number is squared, which makes it positive, and then all squares are added. For example, =SUMSQ(-3,4) returns 25.
Can SUMSQ handle multiple ranges?
Yes. You can supply up to 255 arguments, including separate ranges such as =SUMSQ(A2:A10,C2:C10). Every numeric value in those ranges is squared and added.
Why does SUMSQ return zero for my range?
If every cell in the range is empty or contains text, SUMSQ returns 0. Check that the cells hold real numbers and not text that looks like a number.
Related functions
Every example on this page was recalculated by SheetSkill’s spreadsheet engine. SUMSQ reference