Which Excel Function Should You Use?
Excel gives you more than one standard deviation formula, but the real decision is statistical, not technical. Use `STDEV.S` when your worksheet contains a sample from a larger population, and use `STDEV.P` when the sheet contains the entire population you want to describe.
That means most surveys, classroom subsets, lab replicates, and recent production runs belong in `STDEV.S`. Full employee rosters, all shifts in a closed pilot, or every value in a fixed historical dataset are the main situations where `STDEV.P` makes sense. If that distinction is still fuzzy, read Sample vs. Population first, then compare your result against the site's sample standard deviation calculator or population standard deviation calculator.
Short rule
STDEV.S vs STDEV.P in One Minute
The formulas look similar in Excel, but they divide by different denominators. `STDEV.S` uses `n - 1` through Bessel's correction, while `STDEV.P` uses `N` because no estimation adjustment is needed for a full population.
| Excel function | Use when | Denominator idea | Typical examples |
|---|---|---|---|
| `STDEV.S(range)` | Your data are a sample from a larger group | `n - 1` | Survey responses, 10 parts from a long production line, one class section |
| `STDEV.P(range)` | Your data are the complete population of interest | `N` | All 12 monthly totals for a finished year, every machine in a small fleet, every score in one fixed event |
| `STDEV(range)` | Legacy sample function | Behaves like sample SD | Older workbooks that have not been modernized |
| `STDEVP(range)` | Legacy population function | Behaves like population SD | Older workbooks that have not been modernized |
Why the answers differ
Worked Example: Exam Scores
Suppose `B2:B9` contains eight exam scores from one section: `72, 75, 81, 79, 68, 74, 77, 84`. If those eight students are only one section from a larger course, treat them as a sample.
=AVERAGE(B2:B9)
=STDEV.S(B2:B9)
=STDEV.P(B2:B9)The mean is 76.25. The sample standard deviation is about 5.25, while the population standard deviation for the same eight values is about 4.91. Both calculations are mechanically valid; only one matches the question you are actually asking.
| Formula | Result | Interpretation |
|---|---|---|
| `=AVERAGE(B2:B9)` | `76.25` | Average score |
| `=STDEV.S(B2:B9)` | `5.25` | Best choice if this section is a sample from a larger student population |
| `=STDEV.P(B2:B9)` | `4.91` | Only correct if these eight scores are the entire population of interest |
A useful audit habit is to calculate both once, then explain in one sentence why one belongs in the report. That forces you to clarify the population definition before a spreadsheet default turns into a statistical mistake.
Worked Example: Complete Population
Now imagine `C2:C7` contains the defect counts for every shift in a six-shift pilot that has already ended: `2, 3, 2, 4, 1, 3`. If the pilot itself is the whole group you care about, `STDEV.P` is the right summary.
=AVERAGE(C2:C7)
=STDEV.P(C2:C7)The mean is 2.5 and the population standard deviation is about 0.96. In plain language, shift defect counts typically vary by about one defect from the pilot average. If you later treat that pilot as evidence about a longer process, switch to `STDEV.S` because the pilot becomes a sample.
The same cells can change meaning
Legacy Functions and Data Cleanup
Modern Excel workbooks should prefer `STDEV.S` and `STDEV.P`, but you will still see older files that use `STDEV` and `STDEVP`. Those legacy names are mainly a maintenance problem because teammates may not realize they imply the same sample-versus-population split.
Modern formulas to prefer
Data cleanup before trusting the answer
Excel generally ignores text and empty cells inside referenced ranges for these functions, which is convenient but also dangerous when bad imports hide inside a column. If the worksheet contains grouped counts instead of raw values, do not use a simple range formula. Use Standard Deviation from a Frequency Table instead.
Common Excel Mistakes
- Using `STDEV.P` on a sample:This understates spread slightly and is one of the most common reporting errors in classroom, survey, and QC spreadsheets.
- Calculating SD on averages:Monthly averages, department summaries, or already-aggregated percentages answer a different question from the spread of the raw observations.
- Mixing units:A range that combines milliseconds and seconds, pounds and kilograms, or scores from different scales makes the standard deviation meaningless.
- Copying formulas without checking the range:Relative references can quietly shift from `B2:B9` to the wrong cells. Audit the selected range before trusting copied outputs.
When the next step is interpretation rather than computation, continue with How to Interpret Standard Deviation. If you need to convert a value into relative standing, the z-score calculator and Z-Score Explained are the natural follow-ups.
Excel Checklist
Define the population in words
Use the matching formula
Check the range and the mean
Confirm the data are raw and comparable
Cross-check once outside Excel
The core lesson is simple: `STDEV.S` versus `STDEV.P` is not just an Excel syntax choice. It is a statement about what your data represent. Once that decision is correct, the spreadsheet calculation becomes straightforward.
Further Reading
Sources
References and further authoritative reading used in preparing this article.
- Microsoft Support: STDEV.S function — Microsoft
- Microsoft Support: STDEV.P function — Microsoft
- Microsoft Support: AVERAGE function — Microsoft