Summary

The Excel DEVSQ function returns the sum of the squared deviations from the mean for a given set of data.

Purpose
Get sum of squared deviations
Return value
Calculated sum
Syntax
=DEVSQ(number1, [number2], ...)
  • number1 - First value or reference.
  • number2 - [optional] Second value or reference.

Using the DEVSQ function

The Excel DEVSQ function calculates the sum of the squared deviations from the mean for a given set of data. Variance and standard deviation functions deal with negative deviations by squaring deviations before they are averaged. DEVSQ calculates the sum of the squared deviations from the mean, without dividing by N or by N-1.

The DEVSQ function takes multiple arguments in the form number1, number2, number3, etc. up to 255 total. Arguments can be a hardcoded constant, a cell reference, or a range. A single range or array can be provided instead of multiple arguments.

Examples

In the example shown, the formula in G5 is:

=DEVSQ(B5:B10)

The formulas in C5 and D5 are, respectively:

=B5-$G$4 // deviation
=C5^2 // squared deviation

The value in D12 (34) is simply the sum of D5:D10, and agrees with the value calculated directly by DEVSQ in G5.

Notes

  • Arguments can be numbers, names, arrays, or references that contain numbers.
  • Empty cells, and cells that contain text or logical values are ignored.

Support Exceljet

Many websites (including Exceljet) have lost over half their traffic in the past year because of the crushing impact of AI on web searches. Exceljet is still at it, publishing free content each week. If you find Exceljet helpful, you can support the site and go ad-free with the Exceljet Lifetime Pass. One payment, no subscription, and ads are gone forever. Plus, you get our Excel Shortcuts video course as a thank you.

Get the Lifetime Pass

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.