Spreadsheet Practice

How to calculate standard deviation in Excel

Formula (Excel and Google Sheets)

=STDEV.S(B2:B9)

Use =STDEV.S(B2:B9) for a sample, which is the usual case, or =STDEV.P(B2:B9) when the data is the whole population.

Result on the example
1.60 in E1
Works in
Excel 2010 and later
Google Sheets
Same formula

See it work

The formula is already in E1. Change any input and the result updates, or edit the formula to experiment.

How it works

Standard deviation measures how far values typically sit from the average (4.5 days here). STDEV.S treats the eight orders as a sample of all orders and divides by n − 1, which gives about 1.60 days. STDEV.P divides by n and is for when you have every value there is.

=STDEV.S(B2:B9)

Result1.603567451

  1. B2:B98 rows × 1 col: 3, 5, 4, 7, …

    A range: 8 cells in one column.

  2. STDEV.S(B2:B9)1.603567451

    STDEV: Sample standard deviation (same as STDEV.S).

    • number1B2:B98 rows × 1 col: 3, 5, 4, 7, …

In Google Sheets

The same formula works in Google Sheets: =STDEV.S(B2:B9). We ran it in Google Sheets mode on the same data and it returns 1.60.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=STDEV(B2:B9)1.60The older name for STDEV.S; still works.
=STDEV.P(B2:B9)1.50Different resultFor a complete population. Divides by n instead of n − 1: 1.50.

Common mistakes

  • Text and blanks in the range are ignored, but zeros count. A 0 used for "missing" inflates the spread.
  • With a single value, STDEV.S returns #DIV/0! because n − 1 is 0.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Calculate standard deviation

In E1, calculate the sample standard deviation of the delivery times in B2:B9.

Questions

Should I use STDEV.S or STDEV.P?

Use STDEV.S unless the data is every member of the group you care about, like every employee rather than a survey of some.

How do I calculate standard deviation with a condition?

Filter first: =STDEV.S(FILTER(B2:B9,B2:B9>2)).

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.