How to Calculate Standard Deviation in Excel

Excel has six functions that compute standard deviation, and picking the wrong one silently changes your answer. This guide walks through which function to use, a fully worked example you can reproduce in any version of Excel, and the mistakes that most commonly produce wrong results.

Which function should you use?

Excel splits every statistical function into an older pair and a modern pair, and each pair comes in a sample and a population flavour:

FunctionTypeDivides byUse when
STDEV.SSamplen − 1Your data is a sample of a larger group (the common case)
STDEV.PPopulationnYour data is the entire population
STDEVSample (legacy)n − 1Old workbooks only; identical result to STDEV.S
STDEVPPopulation (legacy)nOld workbooks only; identical result to STDEV.P
STDEVASamplen − 1Text and logical values should count in the calculation
STDEVPAPopulationnSame, for a full population

In nearly every real task the right choice is STDEV.S. The legacy names still work but exist only for compatibility with spreadsheets from the 1990s; new work should use the modern names. The A-variants are a trap: they treat text entries as zero and TRUE/FALSE as 1/0, which is almost never what you intend.

A worked example

Put these eight values in cells A1 to A8: 12, 15, 17, 14, 19, 21, 16, 13.

  1. In cell A9 type =STDEV.S(A1:A8). Excel returns 3.04432…
  2. In cell A10 type =STDEV.P(A1:A8). Excel returns 2.84777… — smaller, because it divides by 8 instead of 7.
  3. To see the intermediate arithmetic, type =AVERAGE(A1:A8) (15.875) and =VAR.S(A1:A8) (9.26786). The square root of the variance is the standard deviation: √9.26786 ≈ 3.04432.

You can check both numbers instantly with the standard deviation calculator — paste the same column and it reproduces every step.

Method 2: Data Analysis ToolPak

If you prefer a dialog to formulas: enable the ToolPak under File → Options → Add-ins → Excel Add-ins → Analysis ToolPak, then open Data → Data Analysis → Descriptive Statistics, select your range, tick "Summary statistics" and read "Standard Deviation" from the output table. Note the ToolPak always reports the sample statistic, so there is no way to get the population figure from it.

Common mistakes

Related functions worth knowing

Excel vs doing it by hand

Excel computes with full double precision internally and displays rounded values, so an answer like 3.0443 may really be 3.044324… underneath. If you chain calculations, reference the SD cell rather than retyping the rounded number, or you will accumulate rounding drift. For quick checks and teaching, the working shown by an online calculator is often clearer than a bare cell result.

FAQ

Does Excel have a single function that decides sample vs population for me?

No — that is deliberate. Excel cannot know whether your data is a sample, so you must choose. When in doubt, STDEV.S.

Why do STDEV and STDEV.S give the same answer?

STDEV.S is the renamed successor of STDEV with identical mathematics. Microsoft introduced the new names around 2010 for consistency.

How do I put the SD into a chart as error bars?

Compute the SD in a cell, then set the chart's custom error-bar value to that cell (±). For means with uncertainty, use the standard error instead of the SD.

Is STDEV.S available in Google Sheets?

Yes, Google Sheets supports STDEV.S and STDEV.P with the same behaviour.