The Excel STDEV Function

Related Function:
STDEVP Function
Standard Deviation

The Standard Deviation is a statistical measure, that is used to identify the amount that a set of values differ (or deviate) from the average value.

When your data set is a sample of a population, (rather than an entire population), you should use a slightly modified form of the Standard Deviation, known as the Sample Standard Deviation. The equation for this is:

Sample Standard Deviation Equation


  • x takes on each value in the set;
  • x is the average (statistical mean) of the set of values;
  • n is the number of values.
A full explanation can be found on the Wikipedia Standard Deviation page
STDEV & STDEV.S Functions

In Excel 2010, the STDEV function has been replaced by the STDEV.S function, which has improved accuracy.

Although it has been replaced, the Stdev function is still available in Excel 2010 (stored in the list of compatibility functions), to allow compatibility with earlier versions of Excel.

Function Description

The Excel STDEV function calculates the sample standard deviation of a supplied set of values.

The syntax of the function is:

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

where the arguments, number1, [number2], etc., are between 1 and 255 numeric values, arrays of values, or references to cells containing numbers. The supplied arguments must provide at least two numeric values to the function.

If you are using a current version of Excel (2007 or later), you can enter up to 255 number arguments to the Stdev function. However, in Excel 2003, the function can only accept up to 30 number arguments.

Note that the Stdev function is used when calculating the standard deviation for a sample of a population (e.g. if your data set records the individual heights of a sample of UK males). If you are calculating the standard deviation of an entire population, you need to use the Stdevp function or the Stdev.P function.

See the page on Standard Deviation in Excel for a comparison of the different Excel standard deviation functions.

Stdev Function Example

Example of use of the Excel Stdev Function

Imagine you want to find the standard deviation of the heights of adult males in London. It is not realistic to measure the height of all males, but you could take a sample of the population and measure their heights.

The example spreadsheet on the rightabove stores the measurements (in cm) of 3,000 adult males. The measured heights are stored in cells B3-B1002, D3-D1002 and F3-F1002.

The standard deviation of the heights of the sample group is calculated in cell H3 of the spreadsheet. The formula for this, (shown in the spreadsheet formula bar), is:

=STDEV( B3:B1002, D3:D1002, F3:F1002 )

As shown in cell H3, the standard deviation in the individual heights of the sample group is calculated to be 5.40 cm.

Other Argument Types

In the example above, the arguments to the Stdev function are input as 3 cell ranges. However, you can also input figures directly, as individual numbers or number arrays.

For example, if you wanted to include two further heights, of 176cm and 177cm into the sample, you could add these directly into the above function as follows:

Either as individual numbers:

=STDEV( B3:B1002, D3:D1002, F3:F1002, 176, 177 )

Or, as an array of numbers:

=STDEV( B3:B1002, D3:D1002, F3:F1002, {176,177} )

For further information and examples of the Excel Stdev function, see the Microsoft Office website.

Stdev Function Errors

If you get an error from the Excel Stdev function this is likely to be one of the following:

Common Errors
#DIV/0! -

Occurs if fewer than two numeric values are supplied to the Stdev function.

(Note that text representations of numbers, that are supplied as a part of an array of cells, are not recognized as numeric values by the Stdev function).
#VALUE! - Occurs if any values that are supplied directly to the Stdev function are text values that cannot be interpreted as numeric values.