Excel STDEV.S: sample standard deviation and quality control
STDEV.S calculates the standard deviation of a sample. Why n−1, how it differs from STDEV.P, quality-control limits and comparing suppliers — with examples.
A flour mill turns out 1,000 bags of 50 kg a day. Weighing them all is impossible — an inspector weighs 6 bags and draws conclusions about the whole batch. That is a sample.
STDEV.S is built for exactly this: “S” stands for sample, meaning your data is part of a larger population. The function estimates the spread of the whole population from the sample.
Surveys, quality control, test measurements, forecasts based on a few months of data — most practical tasks call for STDEV.S.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Bag | Weight (kg) | Measure | Value | ||
| 2 | #1 | 49,8 | Average | 50,017 | ||
| 3 | #2 | 50,3 | STDEV.S | 0,306 | ||
| 4 | #3 | 50,1 | STDEV.P | 0,279 | ||
| 5 | #4 | 49,6 | ||||
| 6 | #5 | 50,4 | ||||
| 7 | #6 | 49,9 | ||||
| 8 |
Syntax and why n − 1
=СТАНДОТКЛОН.В(number1; [number2]; ...)
- number1 — the range of sample values.
- number2, … — more ranges, up to 255.
Text, TRUE/FALSE and empty cells are skipped. You need at least 2 numbers, otherwise #DIV/0!.
The only difference: STDEV.P divides the sum of squares by n, STDEV.S by n − 1. Why: the sample average is calculated from those same values and sits “too close” to them, so the spread looks smaller than it really is. Dividing by n − 1 corrects that bias. The old STDEV function is exactly STDEV.S.
Entering STDEV.S
1
Select E3. Формулы → Вставить функцию → category Statistical → STDEV.S → OK.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Bag | Weight (kg) | ||
| 2 | #1 | 49,8 | ||
| 3 | #2 | 50,3 | ||
| 4 | ||||
| 5 |
2
Select B2:B7 for Number1 and click OK.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Bag | Weight (kg) | Measure | Value | ||
| 2 | #1 | 49,8 | Average | 50,017 | ||
| 3 | #2 | 50,3 | STDEV.S | 0,306 | ||
| 4 | #3 | 50,1 | ||||
| 5 | #4 | 49,6 | ||||
| 6 | #5 | 50,4 | ||||
| 7 | #6 | 49,9 | ||||
| 8 |
3
Report the result together with the average: 50.02 ± 0.31 kg. It means “a typical bag falls within this range”.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Sample size (n) | S / P ratio | ||
| 2 | 3 | 1,225 | ||
| 3 | 5 | 1,118 | ||
| 4 | 10 | 1,054 | ||
| 5 | 30 | 1,017 | ||
| 6 | 100 | 1,005 | ||
| 7 |
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | New bag | Weight | Status | Limit | kg | ||
| 2 | #7 | 50,2 | OK | Lower | 49,40 | ||
| 3 | #8 | 49,2 | Check | Upper | 50,63 | ||
| 4 | #9 | 50,7 | Check | ||||
| 5 | #10 | 49,9 | OK | ||||
| 6 |
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Order | Firm A (days) | Firm B (days) | |
| 2 | 1 | 3 | 4 | |
| 3 | 2 | 5 | 4 | |
| 4 | 3 | 2 | 3 | |
| 5 | 4 | 4 | 4 | |
| 6 | 5 | 6 | 5 | |
| 7 | 6 | 3 | 4 | |
| 8 | Average | 3,83 | 4,00 | |
| 9 | STDEV.S | 1,47 | 0,63 | |
| 10 |
Pro level: confidence intervals and control charts
- Standard error of the mean:
=СТАНДОТКЛОН.В(B2:B7)/КОРЕНЬ(СЧЁТ(B2:B7))— how far the sample average may be from the true one. - 95% confidence interval:
=CONFIDENCE.T(0,05;СТАНДОТКЛОН.В(B2:B7);СЧЁТ(B2:B7))— about 0.32 kg in the flour example. So the batch’s true average weight is 50.02 ± 0.32 kg with 95% confidence. - Control chart: plot the average and ± 3 × STDEV.S lines on a line chart — a point beyond the lines means the process has drifted.
- Filtered data:
=ПРОМЕЖУТОЧНЫЕ.ИТОГИ(7;B2:B100)or=AGGREGATE(7;5;B2:B100)— visible rows only (7 = STDEV.S).
Try it in the simulator
Type =СТАНДОТКЛОН.В(B2:B7) in E3. Then type =E2-2*E3 in E4 and =E2+2*E3 in E5 — these are the control limits. Change B7 to 51.5 — how does the deviation change?
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Bag | Weight (kg) | Measure | Value | ||||||||||||||||||||
| 2 | #1 | 49,8 | Average | 50,0166666667 | ||||||||||||||||||||
| 3 | #2 | 50,3 | STDEV.S | |||||||||||||||||||||
| 4 | #3 | 50,1 | Lower limit | |||||||||||||||||||||
| 5 | #4 | 49,6 | Upper limit | |||||||||||||||||||||
| 6 | #5 | 50,4 | ||||||||||||||||||||||
| 7 | #6 | 49,9 | ||||||||||||||||||||||
| 8 | ||||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 | ||||||||||||||||||||||||
| 11 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.