DEVSQ returns the sum of squared deviations of a set of numbers from their mean. It is a quick way to measure total variability without building helper columns.
=DEVSQ(number1, [number2], …)What does DEVSQ do?
DEVSQ is a statistical function that calculates how spread out a set of numbers is. It takes each value, finds the difference from the average (the deviation), squares that difference, and adds all the squared deviations together. The result is a single number: the sum of squared deviations. A small result means the values cluster tightly around the mean; a large result means they are widely scattered.
Why does this matter? Many everyday decisions depend on consistency. A manager comparing two sales teams wants to know not just which team sold more on average, but which team's results were more predictable. A student analysing experiment data needs to describe variability. DEVSQ gives you that variability figure in one formula, without creating extra columns for deviations and squares.
Imagine you track weekly customer wait times at two service counters. Both have the same average wait, but one counter has wild swings from very fast to very slow. DEVSQ quickly shows which counter is less consistent, helping you target training or staffing changes where they matter most.
When to use DEVSQ
- Comparing consistency of sales figures across regions or teams.
- Measuring variability in manufacturing measurements such as fill weights or dimensions.
- Analysing test scores to see how widely student results vary.
- Checking the stability of website response times or server latency.
- Evaluating forecast errors by summing squared deviations from actual values.
- Summarising spread in scientific or lab data before further statistical tests.
DEVSQ syntax
=DEVSQ(number1, [number2], …)| Argument | Required? | What to enter |
|---|---|---|
number1 | Required | The first number, cell reference, or range containing numeric values. Example: B2:B10 or 150. |
number2 | Optional | Additional numbers, cell references, or ranges. You can supply up to 255 arguments in total. Example: C2:C10. |
What it returns: A single numeric value: the sum of the squared deviations of all supplied numbers from their mean. The result is always zero or positive.
DEVSQ examples
1 Basic spread of five daily sales totals
This example shows the core calculation on a tiny dataset. The goal is to see how much five daily sales figures vary around their average. DEVSQ first finds the mean of B2:B6, then subtracts that mean from each value, squares each difference, and adds the five squared results. The formula returns 4000, meaning the total squared deviation is 4000.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Day | Sales | |||
| 2 | Mon | 100 | 4000 | ||
| 3 | Tue | 120 | |||
| 4 | Wed | 140 | |||
| 5 | Thu | 160 | |||
| 6 | Fri | 180 | |||
| 7 |
2 Comparing two regions with the same average
Both regions have an average monthly sale of 150, but their consistency differs. The goal is to quantify that difference. DEVSQ on B2:B7 returns 7000 for North, while DEVSQ on C2:C7 returns 28000 for South. The larger South result confirms its sales swing much more widely, even though the averages match.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Month | North Sales | South Sales | |||
| 2 | Jan | 100 | 50 | 7000 | ||
| 3 | Feb | 120 | 80 | |||
| 4 | Mar | 140 | 110 | |||
| 5 | Apr | 160 | 190 | |||
| 6 | May | 180 | 220 | |||
| 7 | Jun | 200 | 250 | |||
| 8 |
3 Quality control: fill weights of six bottles
A production line should fill bottles consistently. The goal is to measure total variation in fill weight. DEVSQ on B2:B7 calculates the mean of the six weights, then sums the squared differences from that mean. The result 0.28 shows the overall squared deviation; a smaller value would indicate tighter filling control.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Bottle | Weight (g) | |||
| 2 | 1 | 500.1 | 0.28 | ||
| 3 | 2 | 499.8 | |||
| 4 | 3 | 500.3 | |||
| 5 | 4 | 499.9 | |||
| 6 | 5 | 500.2 | |||
| 7 | 6 | 499.7 | |||
| 8 |
4 Student test scores: measuring class variability
A teacher wants to know how widely scores vary in a small class. The goal is a single variability figure. DEVSQ on B2:B9 finds the mean score, squares each student's distance from that mean, and adds them. The result 1246.875 tells the teacher the total squared spread of scores around the class average.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Student | Score | |||
| 2 | Anna | 70 | 1246.875 | ||
| 3 | Ben | 80 | |||
| 4 | Cara | 90 | |||
| 5 | Dan | 100 | |||
| 6 | Ella | 60 | |||
| 7 | Finn | 85 | |||
| 8 | Gina | 95 | |||
| 9 | Hugo | 75 | |||
| 10 |
5 Forecast error: summing squared deviations from actuals
A planner compares forecast values with actual demand. The goal is to measure total forecast error using squared deviations. Here DEVSQ is applied to the differences in column C, which are already deviations from actual demand. DEVSQ on C2:C7 sums the squares of those differences, returning 700 as the total squared error.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Month | Actual | Forecast Error | |||
| 2 | Jan | 100 | 5 | 700 | ||
| 3 | Feb | 120 | -10 | |||
| 4 | Mar | 110 | 15 | |||
| 5 | Apr | 130 | -5 | |||
| 6 | May | 125 | 10 | |||
| 7 | Jun | 115 | -15 | |||
| 8 |
Common DEVSQ errors and how to fix them
| Error | Why it happens | How to fix it |
|---|---|---|
| #VALUE! | One or more arguments are text that cannot be interpreted as numbers, such as a word typed directly into the formula. | Remove or correct the text argument, or reference only numeric cells. Text inside referenced ranges is ignored, but direct text arguments cause #VALUE!. |
| #DIV/0! | No numeric values are supplied, so the mean cannot be calculated. | Ensure the referenced range contains at least one number. |
| #NUM! | The calculation produces a result too large for Excel to display, often from extremely large numbers. | Check for unrealistic values or scale the data down before applying DEVSQ. |
| #NAME? | The function name is misspelled, for example =DEVQ(...). | Type =DEVSQ( and let Excel suggest the correct name, or correct the spelling. |
Tips for using DEVSQ
- DEVSQ ignores text and logical values inside referenced ranges, so labels in your table will not break the result.
- Use DEVSQ when you need the raw sum of squared deviations; use VAR.S or STDEV.S when you need variance or standard deviation.
- To compare datasets of different sizes, divide DEVSQ by the count or use variance instead, because DEVSQ grows with the number of values.
- You can pass multiple ranges, such as
=DEVSQ(B2:B10, D2:D10), to combine groups into one variability measure. - Remember that DEVSQ always uses the mean of all supplied numbers, so mixing groups changes the reference point.
Frequently asked questions
What is the difference between DEVSQ and VAR.S?
DEVSQ returns the sum of squared deviations. VAR.S divides that sum by (n − 1) to give the sample variance. DEVSQ is the raw total; variance is an average measure.
Does DEVSQ ignore blank cells?
Yes. Blank cells, text, and logical values inside referenced ranges are ignored. Only numeric values are used in the calculation.
Can DEVSQ return a negative number?
No. Squared deviations are always zero or positive, so the result is never negative.
How is DEVSQ related to standard deviation?
Standard deviation is the square root of variance, and variance is DEVSQ divided by (n − 1) for a sample. So DEVSQ is an intermediate step in that calculation.
Related functions
Every example on this page was recalculated by SheetSkill’s spreadsheet engine. DEVSQ reference