← All how-to recipes

How to calculate standard deviation (STDEV.S vs STDEV.P)

✓ Verified in LibreOffice 25.8.7.3

Measure how spread out values are — and pick the right one of the two functions.

The formula

AppFormulaNotes
Excel=STDEV.S(A2:A6)S = sample (your data is a subset). STDEV.P when the range IS the entire population.
Google Sheets=STDEV(A2:A6)STDEV = sample, STDEVP = population; the dotted names also work.
LibreOffice Calc=STDEV.S(A2:A6)Identical to Excel.

How it works

Standard deviation is the typical distance from the mean: for 2,4,4,4,6 (mean 4) the population version gives √1.6 ≈ 1.2649. Use STDEV.S when your rows are a sample of something bigger (it divides by n−1, giving a slightly larger, unbiased estimate — here 1.4142); use STDEV.P only when the data is complete in itself. Roughly two-thirds of normal-ish data falls within one standard deviation of the mean — a quick sanity check for outliers.

Verified, not just documented

We ran =ROUND(STDEV.P(A2:A6),4) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 1.2649 — exactly the expected result. Every formula here is confirmed by actually executing it.