# STDEV function in Excel

> STDEV measures how spread out a set of numbers is, treating them as a sample of a larger group.

Source: https://spreadsheetpractice.com/functions/stdev · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

## Quick answer

- **What it does:** STDEV measures how spread out a set of numbers is, treating them as a sample of a larger group.
- **Syntax:** `=STDEV(number1, [number2], ...)`
- **Most common use:** `=STDEV(B2:B7)` returns 1.87 (Line A fills consistently close to 500 g)
- **Available in:** Every current version
- **Category:** [Statistical functions](https://spreadsheetpractice.com/functions/category/stats)
- **Returns:** The sample standard deviation, or #DIV/0! if there are fewer than two numbers.
- **Google Sheets:** Also available in Google Sheets.

## What it does

STDEV measures how spread out a set of numbers is, treating them as a sample of a larger group. A small result means the values sit close to the average; a large one means they vary a lot. STDEV.S is the newer name for the same calculation.

## Syntax

`=STDEV(number1, [number2], ...)`

| Argument | Required? | What it is |
|---|---|---|
| `number1` | Required | The first number, cell or range in the sample. |
| `number2` | Optional | More numbers, cells or ranges, up to 255 in total. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| F2 | `=STDEV(B2:B7)` | 1.87 | Line A fills consistently close to 500 g |
| F3 | `=STDEV(C2:C7)` | 7.23 | Line B varies about four times as much |
| F4 | `=AVERAGE(B2:B7)+2*STDEV(B2:B7)` | 504.24 | A simple upper control limit: average plus two standard deviations |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Bag | Line A (g) | Line B (g) |  | Check | Result |
| 2 | 1 | 502 | 497 |  | Spread, line A | 1.87 |
| 3 | 2 | 498 | 509 |  | Spread, line B | 7.23 |
| 4 | 3 | 501 | 490 |  | Upper limit, line A | 504.24 |
| 5 | 4 | 499 | 506 |  |  |  |
| 6 | 5 | 500 | 501 |  |  |  |
| 7 | 6 | 503 | 494 |  |  |  |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| #DIV/0! | The range has fewer than two numbers. A standard deviation needs at least two values. |
| The result is a little higher than another tool's | STDEV divides by n-1 (sample). If your numbers are the whole population, use STDEV.P, which divides by n. |
| The sample is smaller than you think | STDEV skips text and blanks in a range, including numbers stored as text. Check with COUNT that every value is included. |

## Tips

- Compare spreads with the coefficient of variation, STDEV divided by AVERAGE, when the averages are very different.

## Related functions

- [STDEV.P](https://spreadsheetpractice.com/functions/stdev-p): STDEV.P measures how spread out a set of numbers is when those numbers are the entire population: every employee, every shift, every student in the class.
- [VAR](https://spreadsheetpractice.com/functions/var): VAR returns the variance of a sample: the average squared distance of each value from the mean.
- [AVERAGE](https://spreadsheetpractice.com/functions/average): AVERAGE adds up the numbers you give it and divides by how many numbers there are.

## Questions

### Should I use STDEV or STDEV.P?

Use STDEV (or STDEV.S) when your data is a sample of a bigger group. Use STDEV.P when you have every value in the group.

### Is STDEV the same as STDEV.S?

Yes. STDEV.S is the name introduced in Excel 2010; both give the same result.

## Practice

A graded STDEV exercise ("Which store is most consistent?") is on [the STDEV page](https://spreadsheetpractice.com/functions/stdev). It is checked instantly, then re-checked on changed data.

Lessons that use STDEV:

- [Lesson 37: Median, quartiles & outliers](https://spreadsheetpractice.com/learn/median-quartiles-outliers) (Pro)

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
