How To Calculate Standard Deviation In Excel (2026)

To calculate standard deviation in Excel, type =STDEV.S(A2:A11) for a sample or =STDEV.P(A2:A11) for a whole population, then press Enter.

Standard deviation tells you how widely the values in your data spread out from their average.

This guide covers which function to pick, how each one treats blanks, text and TRUE or FALSE, and what to do when you get an error.

Table of Contents

Quick answer: which standard deviation function to use

Your data isFunctionDivides by
A sample taken from a larger group=STDEV.S(A2:A11)n-1
The entire population=STDEV.P(A2:A11)n
A sample that includes TRUE, FALSE or text you want counted=STDEVA(A2:A11)n-1

The function details below come from Microsoft’s STDEV.S and STDEV.P pages.

Get your data ready

Put the numbers you want to measure in one column or row, such as A2:A11.

Keep any heading in a separate cell outside the range, because Microsoft’s own example uses A3:A12 so the header and label are left out.

Excel lists no more than 254 number arguments in either function, and each argument can be a whole range.

Decide between sample and population

Use a sample function when your numbers are only part of a bigger group, such as 10 tools tested out of a whole production run.

Use a population function when your numbers are every value in the group you care about.

Microsoft says STDEV.S assumes its arguments are a sample of the population, and that you should use STDEV.P when your data covers the entire population.

For large data sets the two results end up close to each other, according to the STDEV.P page.

How to calculate standard deviation for a sample with STDEV.S

  1. Click an empty cell where you want the answer.
  2. Type =STDEV.S( and then select the cells, or type the range such as A2:A11.
  3. Type the closing bracket and press Enter.

With Microsoft’s breaking-strength numbers (1345, 1301, 1368, 1322, 1310, 1370, 1318, 1350, 1303 and 1299), the result is 27.46391572.

STDEV.S uses the n-1 method, which is why it comes out larger than the population version on the same numbers.

How to calculate standard deviation for a population with STDEV.P

  1. Click an empty cell.
  2. Type =STDEV.P( and select the same range.
  3. Close the bracket and press Enter.

On the same ten values, Microsoft shows a result of 26.05455814, because STDEV.P uses the n method and divides by the number of values.

Formula on the same 10 valuesResult on Microsoft’s page
=STDEV.S(A3:A12)27.46391572
=STDEV.P(A3:A12)26.05455814
=STDEVA(A3:A12)27.46391572

The STDEVA result matches STDEV.S here because every value is a plain number.

Use the Insert Function box instead of typing

  1. Select the cell for the result.
  2. Select the Insert function button (the fx icon) to open the Insert Function dialog box.
  3. Type a short description such as standard deviation in the search box and select Go.
  4. Select a function name once to read its syntax and short description.
  5. Double-click the name to open the Function Arguments window.
  6. Pick your cells in the Number1 box and select OK.

The same dialog has a Help on this function link that opens Microsoft’s reference page for the function you have selected.

What each function counts and ignores

Item in the rangeSTDEV.S and STDEV.PSTDEVA
NumbersCountedCounted
Empty cellsIgnoredIgnored
Text in a referenceIgnoredIgnored
TRUE in a referenceIgnoredCounted as 1
FALSE in a referenceIgnoredCounted as 0
Error value in a referenceIgnored in the array or referenceCauses an error

Microsoft’s STDEVA page says text and FALSE evaluate as 0 and TRUE evaluates as 1, while empty cells and text values in an array or reference are ignored.

Numbers typed straight into the formula work differently, because logical values and numbers written as text are counted there.

Population versions that include logicals and text

STDEV.P ignores logical values and text in a range.

To include them for a whole population, Microsoft points you to STDEVPA.

To include them for a sample, use STDEVA.

Old function names you may still see

Older nameWhat Microsoft lists it as
STDEVListed as a related function on the STDEV.S page
STDEVPListed as a related function on the STDEV.S page
STDEVPAPopulation version that includes logicals and text

The STDEV.P page tells you to use STDEV for sample data, so files made years ago may still carry it.

Which Excel versions support these functions

Microsoft lists STDEV.S and STDEV.P for Excel for Microsoft 365 on Windows and Mac, Excel for the web, Excel 2024, Excel 2021, Excel 2019 and Excel 2016.

That covers most copies in use today.

Fix common errors and wrong results

SymptomLikely causeFix
#NAME?A typo in the function nameCorrect the spelling and use the autocomplete list that appears as you type
Error from a typed argumentText that cannot be turned into a numberReplace it with a number or a cell reference
Error from a rangeA cell in the range holds an error value, and you used STDEVAFix the error cell or switch to STDEV.S
Result looks too small or too largeSample and population functions swappedCheck which one matches your data
Text-stored numbers skippedNumbers in a range stored as text are ignoredConvert them to real numbers first

Microsoft says the most common cause of a #NAME? error is a typo in the formula name, and it warns against hiding the error with IFERROR.

For other formula errors, see our guide to fixing #N/A, #VALUE! and #REF! errors in Excel.

Turn on the Analysis ToolPak if you need it

  1. Select File, then Options, then Add-Ins.
  2. In the Manage box, select Excel Add-ins, then select Go.
  3. Check Analysis ToolPak and select OK.
  4. If it is not listed, select Browse to find it, and select Yes if Excel offers to install it.

Microsoft’s Load the Analysis ToolPak page adds that these tools work on one worksheet at a time.

With grouped worksheets, results appear on the first sheet and the others get empty formatted tables, so you run the tool again on each sheet.

If you want totals first, read how to use AutoSum and the SUM function in Excel.

For ratios, see how to calculate a percentage in Excel.

For date work, see how to calculate days between dates in Excel.

The full list of statistical functions is on Microsoft’s Statistical functions reference.

Leave a Reply

Your email address will not be published. Required fields are marked *