DEVSQ Function

Excel Functions › Statistical

All versions Statistical

The Excel DEVSQ function returns the sum of the squared deviations of each value from the data set's mean — the building block behind variance, standard deviation, and least-squares regression.


Quick answer:
=DEVSQ({4,5,8,7,11,4,3}) sum of squared deviations = 48

Syntax

=DEVSQ(number1, [number2], ...)
ArgumentDescription
number1RequiredThe first value, reference, or array for which you want the sum of squared deviations.
number2, ...OptionalUp to 254 additional numbers or ranges. You can use a single array or up to 255 arguments.

How to use it

DEVSQ first finds the mean of all the values, then for each value subtracts the mean, squares the result, and adds them all up. For {4,5,8,7,11,4,3} the mean is 6, and the squared deviations (4, 1, 4, 1, 25, 4, 9) sum to 48.

=DEVSQ({4,5,8,7,11,4,3}) // mean 6, sum of squares = 48

This quantity, the sum of squares, is the numerator of the variance formulas: dividing DEVSQ by n−1 gives VAR.S, and dividing by n gives VAR.P. It also appears throughout regression as the total or residual sum of squares.

Text, logical values, and empty cells inside a referenced range are ignored, so DEVSQ is safe to point at a column that mixes numbers with headers or blanks.

Tip: DEVSQ is more numerically stable than computing SUMPRODUCT((data-AVERAGE(data))^2) by hand, and far clearer to read in a formula audit.

Try it: interactive demo

Live demo

Enter a comma-separated list of numbers to see the sum of squared deviations from the mean.

Result:

Practice workbook

📊
Download the free DEVSQ practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

What does DEVSQ actually calculate?
It returns the sum of the squared differences between each data point and the mean of the data: Σ(x − mean)². This is the “sum of squares” used in variance and regression.
How is DEVSQ related to variance?
Variance is just DEVSQ divided by a count. VAR.S equals DEVSQ()/(n−1) and VAR.P equals DEVSQ()/n. So DEVSQ is the numerator both variance formulas share.
How is DEVSQ different from AVEDEV?
AVEDEV averages the absolute deviations from the mean, while DEVSQ sums the squared deviations. DEVSQ penalizes large deviations more heavily and is the basis for variance.
Does DEVSQ ignore text and blank cells?
Yes. When pointed at a range, DEVSQ skips text, logical values, and empty cells, computing only over the numeric entries.

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: VAR.S · VAR.P · STDEV.S · AVEDEV · SUMSQ · STEYX