← All how-to recipes

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

✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)

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

The formula

AppFormulaNotes
Excel (desktop)=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. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 1.2649 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.

Functions used

STDEV.S · STDEV — see full Excel, Google Sheets & LibreOffice compatibility for each.

Related recipes