How to Calculate Standard Deviation in Excel

STDEV.S vs STDEV.P, with the exact formulas and a worked example

Quick answer: Use =STDEV.S(range) for a sample and =STDEV.P(range) for a whole population. For example, =STDEV.S(A2:A11) returns the sample standard deviation of the values in cells A2 through A11.

Or use the Standard Deviation Calculator →

Which function should you use?

Excel has two main functions. STDEV.S calculates the sample standard deviation (dividing by n − 1) and is the right choice when your data is a sample from a larger population — the most common case. STDEV.P calculates the population standard deviation (dividing by n) and is used only when your data covers the entire group. The older STDEV and STDEVP functions still work and are equivalent to STDEV.S and STDEV.P respectively.

Worked example

Suppose the values 5, 7, 3, 7, 8, 5, 9, 6, 4, 6 are in cells A2:A11.

Sample standard deviation: =STDEV.S(A2:A11) → about 1.83.

Population standard deviation: =STDEV.P(A2:A11) → about 1.73.

The mean, for reference: =AVERAGE(A2:A11)6.

Common mistakes

The most frequent error is choosing the wrong function — using STDEV.P on sample data understates the spread. Other pitfalls: including header cells or blank cells in the range, letting text values silently drop out of the calculation, and confusing standard deviation with variance (use VAR.S or VAR.P for variance, which is the square of the standard deviation). Google Sheets uses the same function names, so these formulas work there too.

Check your work

To verify a spreadsheet result, paste the same numbers into the standard deviation calculator, which reports both the sample and population values along with a step-by-step breakdown.

Step by step

  1. Enter your data. Put each value in its own cell, for example down column A from A2 to A11.
  2. Pick the function. Use STDEV.S for a sample or STDEV.P for a full population.
  3. Type the formula. In an empty cell enter =STDEV.S(A2:A11), adjusting the range to your data.
  4. Press Enter. Excel returns the standard deviation. Add =AVERAGE(A2:A11) to see the mean alongside it.

Frequently asked questions

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

STDEV.S divides by n − 1 and is for samples; STDEV.P divides by n and is for an entire population.

Is STDEV the same as STDEV.S?

Yes. The legacy STDEV function is equivalent to STDEV.S, and STDEVP is equivalent to STDEV.P.

Do these formulas work in Google Sheets?

Yes. Google Sheets supports the same STDEV.S and STDEV.P functions with identical syntax.

Calculators

More guides