Statistics

How to Calculate Standard Deviation in Excel and Google Sheets

Choose sample or population standard deviation in Excel and Google Sheets. Verify formulas, numeric counts, missing data and a complete worked example. This guide explains the reasoning, not just the keystrokes.

Published · Updated · 4 min read

Audit the range with a second numerical scenario

Change the final observation in the example from 11 to 13. The new mean is 7.4 and the squared-deviation total becomes 59.2. Population variance is 11.84 and sample variance is 14.8. This second scenario is useful because the former mean of seven no longer applies. A worksheet accidentally referring to an old mean cell may pass the first example and fail this one. Recalculate rather than editing only the displayed standard-deviation output.

Outliers are not automatically invalid data. Check a surprising entry against its source and measurement units before removing it. If an exclusion is justified, preserve both the original range and the exclusion rule so the analysis is reproducible. A smaller standard deviation after deleting an extreme value does not by itself prove the revised analysis is better. Statistical functions carry out the requested calculation; they do not determine whether the selected records represent the intended population.

Decide whether the range is a sample or population

Use a sample standard deviation when estimating population spread from a sample, and a population calculation when describing the complete population defined for the question. The choice is not determined simply by whether the spreadsheet is large. Both Excel and Google Sheets provide sample and population functions. Keep the selection in the output label so a later reader does not compare different denominators as though they represented the same statistic.

Enter a small check range

Put 3, 5, 7, 9 and 11 in A2:A6. Their mean is 7. Subtracting it produces deviations −4, −2, 0, 2 and 4, whose squares are 16, 4, 0, 4 and 16. The squared-deviation total is 40. This short independent calculation gives a reliable reference when building the worksheet, because it tests the denominator and square root instead of relying only on a function name.

Use the correct spreadsheet functions

In Excel, =STDEV.S(A2:A6) gives sample standard deviation sqrt(40/4), approximately 3.162277660. =STDEV.P(A2:A6) gives population standard deviation sqrt(40/5), approximately 2.828427125. In Google Sheets, =STDEV(A2:A6) is the sample function and =STDEVP(A2:A6) is the population function. Choose the documented function for the intended denominator; an older-looking name does not by itself mean the equation differs.

Check variance separately

For the same five values, sample variance is 10 and population variance is 8. Squaring the corresponding standard deviation should recover its variance within numerical precision. Units differ: if observations are centimeters, standard deviation is centimeters and variance is square centimeters. Comparing a variance output of 10 with a standard deviation output near 3.1623 as though one must be wrong overlooks that square-root relationship.

Checks for 3, 5, 7, 9, 11
ModelVarianceStandard deviation
Population; divisor 582.828427125
Sample; divisor 4103.162277660

Squared deviations total 40; displayed square roots are rounded.

Validate numbers and missing entries

Use =COUNT(A2:A6) to verify five numeric observations. Referenced text and blank cells can be ignored by statistical functions, so a plausible answer does not prove that every intended observation was included. A measured zero is included and must not be deleted merely because it looks like an empty result. Functions that deliberately treat text as zero have different semantics; do not switch to them as a quick fix for imported data.

Test small and constant ranges

A sample standard deviation needs at least two numeric observations because its denominator is n−1. A one-value population description can have standard deviation zero, but that does not provide evidence of zero uncertainty in an unknown population. A repeated constant list gives zero spread under both supported denominators when enough values exist. Keep invalid or insufficient ranges visibly flagged rather than replacing every formula error with a numeric zero.

Cross-check the website with identical observations

Enter 3,5,7,9,11 into the Standard Deviation Calculator and select the same sample or population model as the sheet. Confirm count five, mean seven and the relevant variance and standard deviation. The website validates raw input items instead of reproducing every spreadsheet range-coercion rule. A mismatch should prompt a review of observations, missing entries and denominator before attributing it to rounding. Retain full intermediate precision when comparing results.

Save the statistical definition with the output

Record the numeric range, observation units, sample/population choice and exclusion rules. Extend the range deliberately when new rows arrive and recheck its numeric count. Standard deviation describes spread around the mean; it does not automatically provide a confidence interval, establish normality or measure the precision of the mean. Use the standard-error guide for that separate question, and preserve enough context that a displayed number remains meaningful after the worksheet is shared.

Frequently asked questions

Which function is sample SD in Sheets?

STDEV is the documented sample function; STDEVP describes a population.

Does a larger range require population SD?

No. Choose according to the population and inference question, not only row count.

Are text numbers safe?

Validate and convert them deliberately; referenced text may be omitted.

Can an error be replaced with zero?

That can hide insufficient or invalid input. Report the cause instead.

Sources

References used to support definitions and interpretation in this guide.

  1. Microsoft — Statistical Functions
  2. Google — STDEV
  3. OpenStax — Measures of Spread