Formula for STDEV in Excel

If you just need to formula for stdev in excel and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: use =STDEV.S(range) for a sample and =STDEV.P(range) for a whole population — it measures how far values typically sit from the mean.

On this page8

Syntax

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

Arguments

Argumentrequired / optionalDescription
number1requiredThe first number or range.
number2, ...optionalFurther values or ranges. Text and blanks are ignored.

Related functions

VARAVERAGESTANDARDIZE
▤Annotated stepsExcel
1

Decide whether the data is a sample or the entire population — that choice picks the function.

2

Select the result cell and type =STDEV.S( for a sample, or =STDEV.P( for a population.

3

Select the range and press Enter.

4

Combine with AVERAGE to build control limits at one, two or three deviations from the mean.

Ctrl+CthenCtrl+Shift+V⌘+Cthen⌘+Ctrl+VPaste values · WindowsMac

What this does

Standard deviation summarises spread in the same units as the data. Excel splits it in two, and choosing wrongly is the classic error: STDEV.S divides by n-1 and is correct when your data is a sample of something larger; STDEV.P divides by n and is correct only when you hold every member of the population. The difference shrinks as the dataset grows but is material on small ones. The legacy STDEV matches STDEV.S. Because it is the square root of the variance, the two always agree — STDEV is simply the one in readable units. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. For “formula for stdev in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected formula change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a calculation you can defend to a CFO or an auditor useful in real work: repeatable, auditable, and not dependent on memory or luck.

A worked example

Twelve monthly delivery times in B2:B13, treated as a sample of ongoing performance: =STDEV.S(B2:B13) might return 1.8 days against a mean of 4.2. Control limits then follow directly: =AVERAGE(B2:B13)+2*STDEV.S(B2:B13) marks the upper bound of normal variation. Standard deviation is what turns "the average is 4.2 days" into a statement about reliability, which is the part decisions actually rest on. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.

In Google Sheets

Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. Keep this page bookmarked for the next time the same question comes up. Better still, repeat the steps once in your own workbook — doing it yourself is what turns a copied answer into something you remember. For “formula for stdev in excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.

Common mistakes

  • Using STDEV.P on sample data, which understates the spread — the n-1 divisor in STDEV.S exists to correct exactly that.
  • Interpreting the standard deviation without the mean; the same 1.8 means something very different against a mean of 4 than against a mean of 400.
  • Applying it to strongly skewed data, where the standard deviation implies a symmetry the data does not have.

Frequently asked questions

What is the difference between STDEV.S and STDEV.P?

STDEV.S divides by n-1 and is for samples; STDEV.P divides by n and is only correct when the data covers the entire population.

Which should I use?

Almost always STDEV.S. Real datasets are nearly always samples of an ongoing process rather than a closed population.

How does it relate to variance?

It is the square root of the variance, which puts it back in the original units and makes it directly comparable to the mean.