Skip to content

STDEV.S

Returns the standard deviation of a sample: how far values typically sit from their average, when the data is a sample of a larger group.

Syntax

=STDEV.S(, [number2], ...)

Statistical

Excel 2010 and later, including Excel for Microsoft 365 and Excel for the web. The older STDEV function works in every version.

Try it

Edit the formula in B11 or change the inputs. The sheet recalculates as you type.

B11
A
B
C
1
Order
Lead time (days)
2
O-1
12
3
O-2
14
4
O-3
14
5
O-4
14
6
O-5
15
7
O-6
15
8
O-7
17
9
O-8
19
10
11
Std deviation
2.14

B11 =ROUND(STDEV.S(B2:B9),2) returns 2.14

How STDEV.S works

STDEV.S measures spread. A small standard deviation means values cluster close to the average. A large one means they are scattered. Use it to judge how consistent lead times, order sizes, test scores or machine output are.

Sample versus population

STDEV.S treats your numbers as a sample, a subset of a bigger group, and divides the sum of squared deviations by n − 1 instead of n. That correction makes the estimate of the whole group's spread less biased. Use STDEV.S when:

  • you measured some orders, customers or days out of many;
  • you want to say something about the process or population behind the data.

Use STDEV.P when your data is the whole group, such as every machine in the plant, or every branch.

For eight lead times of 12, 14, 14, 14, 15, 15, 17 and 19 days, the average is 15. STDEV.P gives 2 and STDEV.S gives about 2.14. The gap shrinks as the sample grows.

What it ignores

In a range or cell reference, STDEV.S skips text, blanks and TRUE/FALSE. Numbers typed straight into the formula, and logical values and text numbers typed as arguments, are counted. If the data includes any error value, the result is that error. With fewer than two numbers, STDEV.S returns #DIV/0!, because a sample of one has no spread to measure.

Reading the number

Standard deviation is in the same units as your data. A standard deviation of 2.14 days on an average of 15 days is small. The same 2.14 on an average of 3 days would be very large. Divide by the average to get the coefficient of variation, =STDEV.S(B2:B9)/AVERAGE(B2:B9), to compare spread across data sets with different scales.

For roughly bell-shaped data, about two thirds of values fall within one standard deviation of the average and about 95% within two. =AVERAGE(B2:B9)+2*STDEV.S(B2:B9) is a common upper limit.

STDEV and STDEV.S

The older STDEV function gives identical results and is kept for compatibility. Prefer STDEV.S in new work because the name states the method. The square of a standard deviation is the variance: see VAR.S. To compare spread without being swayed by outliers, see QUARTILE.INC.

Arguments

number1
The first number, cell or range of the sample, such as B2:B9.
number2, ...optional
More numbers, cells or ranges, up to 254 more arguments. Text, blanks and TRUE/FALSE inside ranges are ignored.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Sample standard deviation of lead times

B11 =ROUND(STDEV.S(B2:B9),2)

Result: 2.14

The average is 15 and the squared deviations add up to 32. Dividing by n - 1 = 7 and taking the square root gives 2.138, rounded to 2.14.

B11
A
B
C
1
Order
Lead time (days)
2
O-1
12
3
O-2
14
4
O-3
14
5
O-4
14
6
O-5
15
7
O-6
15
8
O-7
17
9
O-8
19
10
11
Std deviation
2.14

B11 =ROUND(STDEV.S(B2:B9),2) returns 2.14

Example 2

Spread relative to the average

B11 =ROUND(STDEV.S(B2:B9)/AVERAGE(B2:B9),3)

Result: 14.3%

The standard deviation is about 14% of the average, which makes it easy to compare with a data set measured in different units.

B11
A
B
C
1
Order
Lead time (days)
2
O-1
12
3
O-2
14
4
O-3
14
5
O-4
14
6
O-5
15
7
O-6
15
8
O-7
17
9
O-8
19
10
11
Coefficient of variation
14.3%

B11 =ROUND(STDEV.S(B2:B9)/AVERAGE(B2:B9),3) returns 14.3%

Example 3

An upper limit two deviations above average

B11 =ROUND(AVERAGE(B2:B9)+2*STDEV.S(B2:B9),1)

Result: 19.3

Average 15 plus twice 2.138 is 19.28, rounded to 19.3 days. Orders slower than that are unusual for this process.

B11
A
B
C
1
Order
Lead time (days)
2
O-1
12
3
O-2
14
4
O-3
14
5
O-4
14
6
O-5
15
7
O-6
15
8
O-7
17
9
O-8
19
10
11
Upper limit
19.3

B11 =ROUND(AVERAGE(B2:B9)+2*STDEV.S(B2:B9),1) returns 19.3

Example 4

One value is not enough

B4 =STDEV.S(B2)

Result: #DIV/0!

A sample needs at least two numbers. With one, STDEV.S divides by n - 1 = 0.

B4
A
B
C
1
Order
Lead time (days)
2
O-1
12
3
4
Std deviation
#DIV/0!
5
6

B4 =STDEV.S(B2) returns #DIV/0!

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

The six batches are a sample of production. In B9, return the standard deviation of the cycle times.

Answer in B9.

B9
A
B
C
1
Batch
Cycle time (min)
2
B-1
45
3
B-2
52
4
B-3
48
5
B-4
50
6
B-5
55
7
B-6
50
8
9
Std deviation
10
Upper control limit
11

Common mistakes

  • STDEV.S and STDEV.P give different answers on the same data. Use STDEV.S for a sample and STDEV.P only when the data is the whole group.
  • With fewer than two numbers, STDEV.S returns #DIV/0!. Wrap it in IFERROR if the range can be short.
  • Text, blanks and TRUE/FALSE in a range are skipped. Numbers stored as text are skipped too, so the deviation may be based on fewer values than you think. Compare with COUNT.
  • Zeros that mean "no data" inflate the spread. Clean the range, or filter it, before calculating.
  • Standard deviation is sensitive to outliers. One extreme value can double it. Check the data with a chart, or compare with the interquartile range.

Questions people ask

What is the difference between STDEV and STDEV.S?

They return the same result. STDEV.S is the newer name from Excel 2010, and STDEV is kept for compatibility. Use STDEV.S in new work.

When should I use STDEV.S instead of STDEV.P?

Use STDEV.S when your data is a sample from a larger group, which is the usual case. Use STDEV.P only when you have every member of the group.

Why does STDEV.S return #DIV/0!?

The range holds fewer than two numbers, so there is no spread to measure. Check that the values are numbers and not text.

How do I calculate standard deviation for one group only?

Filter the values first: `=STDEV.S(IF(A2:A9="East",B2:B9))`. It works as typed in Microsoft 365 and needs Ctrl+Shift+Enter in older versions.

Learn STDEV.S in a real sheet.

Tracks take you from the basics to modelling, one graded exercise at a time.