Practice free

DEVSQ function

DEVSQ adds up the squared distance of each value from the average and returns that total. It is the raw ingredient behind variance and standard deviation.

Example

Read it as a sentence: add up the squared distances of the numbers in A1:A8 from their average, which gives 32.

Practice this in the app

Syntax

DEVSQ(number1, [number2], ...)

Arguments in [square brackets] are optional.

number1 (required)
First number, array or range.
number2 (optional)
Further numbers or ranges.

Returns: The sum of squared deviations from the mean.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=DEVSQ({2,4,4,4,5,5,7,9}) 32 Array constant
=DEVSQ(10,"20",TRUE) 180.6666667 Direct args: number, text-number, TRUE
=DEVSQ(5) 0 Single number
=DEVSQ({1,"2",TRUE,3}) 2 Array with text and boolean
=DEVSQ(Data!A1:A8) 32 Range of numbers
=DEVSQ(Data!B1:B8) 466.6666667 Mixed range: num, text-number, TRUE, blank, text, FALSE
=DEVSQ(10,"abc") #VALUE! Direct arg: non-numeric text
=DEVSQ(Data!C1:C5) #N/A Range containing #N/A

The Data sheet these formulas read

A cell that starts with = holds that formula.

Watch out for

  • It is a total, not an average, so it grows with the number of values.
  • Text and blanks in ranges are ignored.

Where it works

Excel
DEVSQ is in every version of Excel from 2007 on.
Google Sheets
Same name, same behaviour for everyday use.

Part of Statistical functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .