STDEV function
Estimates the standard deviation of a population from a sample (divides by n − 1). Replaced by STDEV.S.
Available in All versions of Excel, including Microsoft 365 and Excel for the web (kept for compatibility)
In every Excel versionWorks in Google Sheets
Syntax
STDEV(number1, [number2], ...)| Argument | What it means | |
|---|---|---|
number1 | Required | A number, range or array from the sample. |
number2, ... | Optional | Up to 255 numbers or ranges in total. |
Returns: The sample standard deviation.
How STDEV works
Standard deviation measures how spread out values are around their average, in the same units as the data. A small value means the numbers cluster tightly (consistent fill weights, steady delivery times); a large one means they vary a lot. STDEV assumes your data is a sample from a bigger population, which is almost always the case: a week of orders, a batch of test parts, a class of students.
It calculates √(Σ(x − mean)² / (n − 1)). Dividing by n − 1 instead of n (Bessel's correction) compensates for the fact that a sample's own mean sits closer to its values than the true population mean does. Text and logical values inside ranges are ignored; use STDEVA if you want them counted. You need at least two numbers.
Compatibility note: since Excel 2010 STDEV is a compatibility function. STDEV.S calculates exactly the same thing with a clearer name. If your data is the entire population (every employee, every day of the year), use STDEV.P instead, the modern version of STDEVP.
Examples
1Spread of fill weights
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Bag | Weight (g) | ||
| 2 | 1 | 498 | 3.43 | |
| 3 | 2 | 502 | ||
| 4 | 3 | 495 | ||
| 5 | 4 | 505 | ||
| 6 | 5 | 500 | ||
| 7 | 6 | 499 |
Result: 3.43
The mean is 499.83 g and the sample standard deviation is 3.43 g (formatted to 2 decimals): most bags are within about ±3.4 g of the average.
2Test scores
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Student | Score | ||
| 2 | Ana | 72 | 10.25 | |
| 3 | Ben | 85 | ||
| 4 | Cara | 64 | ||
| 5 | Dev | 91 | ||
| 6 | Eli | 78 | ||
| 7 | Fay | 69 | ||
| 8 | Gus | 88 |
Result: 10.25
The class average is 78.14 and the scores typically vary by about 10.3 points (shown to 2 decimals). =STDEVP(B2:B8) would give a slightly smaller 9.49 because it divides by 7 instead of 6.
3Annualised volatility from monthly returns
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Month | Return | ||
| 2 | Jan | 0.021 | 7.37% | |
| 3 | Feb | -0.013 | ||
| 4 | Mar | 0.034 | ||
| 5 | Apr | 0.008 | ||
| 6 | May | -0.022 | ||
| 7 | Jun | 0.017 |
Result: 7.37%
Monthly returns vary by 2.13%; multiplying by √12 scales that to an annual volatility of 7.37% (cell formatted as a percentage with 2 decimals).
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#DIV/0! | Fewer than two numbers in the arguments (for example a range of text or blanks). | Check that the range contains numbers, not numbers stored as text. |
#VALUE! | A direct argument is text that cannot be read as a number. | Use ranges, or convert with VALUE. |
Tips
- Sample or population? If the data is everything you care about, use STDEVP / STDEV.P; if it stands for something bigger, use STDEV / STDEV.S.
- Numbers stored as text are silently skipped in ranges, which can make the result wrong without an error. Check with COUNT.
- About 68% of normally distributed values lie within one standard deviation of the mean and 95% within two.
Questions
What is the difference between STDEV and STDEVP?
STDEV treats the data as a sample and divides by n − 1; STDEVP treats it as the whole population and divides by n. For a sample, STDEV gives the better estimate.
Should I use STDEV or STDEV.S?
They return identical results. Use STDEV.S in new workbooks; STDEV is kept so older files keep working.
Why does STDEV return #DIV/0!?
It needs at least two numeric values. Text that looks like numbers is ignored.
Google Sheets
STDEV also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
STDEV in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | SMODCH.VÝBĚR |
| Danish | STDAFV |
| Finnish | KESKIHAJONTA |
| French | ECARTYPE |
| German | STABW |
| Hungarian | SZÓRÁS |
| Italian | DEV.ST |
| Norwegian (Bokmål) | STDAV |
| Polish | ODCH.STANDARDOWE |
| Portuguese (Brazil) | DESVPAD |
| Portuguese (Portugal) | DESVPAD |
| Russian | СТАНДОТКЛОН |
| Spanish | DESVEST |
| Swedish | STDAV |
| Turkish | STDSAPMA |