Statistical

DEVSQ Formula

DEVSQ returns the sum of the squared deviations of each data point from the sample mean. It is a building block for other statistical calculations — variance is DEVSQ divided by n-1, and it appears in regression, ANOVA, and many other formulas. Use it when you need the raw sum of squares for custom calculations.

Syntax

DEVSQ(value1, [value2, ...])
ParameterDescription
value1 Parameter of the DEVSQ function.
[value2 (Optional.) Parameter of the DEVSQ function.
...] Parameter of the DEVSQ function.
Try DEVSQ in Viztab — free, no signup

Examples

Sum of squared deviations

Formula
=DEVSQ(B2:B50)
Returns the total squared deviation from the mean for 49 values. This is the numerator in the variance formula.

Manual variance check

Formula
=DEVSQ(A1:A100) / (COUNT(A1:A100) - 1)
Manually calculates sample variance — should match VAR(A1:A100) exactly.

Total variation

Formula
=DEVSQ(C2:C1000)
Returns the total sum of squares (SST), a key component in R-squared and regression analysis.

Common Errors

#DIV/0!

No numeric values in the arguments (internally divides by count to compute mean).

#VALUE!

Non-numeric direct arguments.

Tips

Relationship to variance

DEVSQ / (n-1) = VAR.S and DEVSQ / n = VAR.P. DEVSQ gives you the raw numerator before dividing.

Used in regression

In linear regression, Total SS = DEVSQ(Y). Regression SS + Residual SS = Total SS. R-squared = Regression SS / Total SS.

Sensitive to outliers

Because deviations are squared, DEVSQ is heavily influenced by extreme values. A single outlier can dominate the sum.

Try DEVSQ in Viztab

Import your data and use DEVSQ with 370+ other formulas. No signup required.

Open Viztab

Related Formulas