Standard deviation
Standard deviation measures how far values typically sit from the mean. Subtract the mean from each value, square the results, average them (dividing by n - 1 for a sample or n for a population) and take the square root.
Syntax
s = sqrt( sum((x - mean)^2) / (n - 1) )| Part | What it is |
|---|---|
x | each value |
mean | the average of the values |
n | the number of values; use n - 1 for a sample, n for a whole population |
Examples
Data: 2, 4, 4, 4, 5, 5, 7, 9 (n = 8, mean = 5)
squared deviations: 9, 1, 1, 1, 0, 0, 4, 16 (sum = 32)
population sd = sqrt(32 / 8) = sqrt(4)Result: 2
Excel: =STDEV.P(A1:A8)
Same data as a sample
sample sd = sqrt(32 / 7) = sqrt(4.5714)Result: 2.138 (rounded)
Excel: =STDEV.S(A1:A8)
Data: 1, 2, 3, 4, 5 (mean = 3)
squared deviations: 4, 1, 0, 1, 4 (sum = 10)
sample sd = sqrt(10 / 4)Result: 1.581 (rounded)
Common mistakes
- Using STDEV.P on a sample understates the spread; use STDEV.S (n - 1) unless you truly have every member of the population.
- Forgetting to square the deviations lets positives and negatives cancel to zero; square first, then average.
- Reporting the variance as the standard deviation; the variance is in squared units, so take the square root.
- Comparing standard deviations of data measured on different scales; use the coefficient of variation instead.
Practice Standard deviation
These drills check your answer on live data, free, no account needed.
- Sample standard deviationA random sample of 6 minutes to resolve a support ticket (minutes): 46, 35, 28, 23, 26, 17. What is the sample standard deviation? Round to 2 decimal places.
- Population standard deviationThese are the figures for every store in a small retail chain, so they are the whole population, not a sample. Weekly revenue in thousands of dollars: 63, 50, 42, 37, 39. What is the population standard deviation? Round to 2 decimal places.
Questions
What is the difference between STDEV.S and STDEV.P in Excel?
STDEV.S divides by n - 1 and estimates the spread of a population from a sample. STDEV.P divides by n and describes the spread of the exact data you have. STDEV.S is always slightly larger.
What does a standard deviation of 0 mean?
Every value is identical. The larger the standard deviation, the more spread out the values are around the mean.
Why divide by n - 1 for a sample?
Deviations are measured from the sample mean, which sits closer to the sample values than the true population mean does, so the squared deviations are a little too small. Dividing by n - 1 (Bessel's correction) removes that bias.
Related
- VarianceHow to calculate variance step by step, why the sample version divides by n - 1, how it relates to standard deviation, and Excel VAR.S and VAR.P.
- z-scoreThe z-score formula z = (x - mean) / sd, worked examples, how to read a z-score as a percentile with the normal table, and the Excel function STANDARDIZE.
- Coefficient of variationThe coefficient of variation (CV) is the standard deviation divided by the mean, as a percent. Formula, worked examples, Excel and when it misleads.
- Empirical rule (68-95-99.7)The empirical rule: 68% of normal data lies within 1 standard deviation of the mean, 95% within 2 and 99.7% within 3. Worked examples for intervals and tails.