How to Find Standard Deviation in Excel With Formulas

Formulas & functions · Updated November 3, 2026

How to Find Standard Deviation in Excel With Formulas

To find standard deviation in Excel, enter =STDEV.S(B2:B9) for a sample or =STDEV.P(B2:B9) for an entire population, replacing B2:B9 with your data range. The first formula is the usual choice when your data represents part of a larger group; the second is for a complete group. Before calculating, decide which description fits your data.

What You’ll Need

  • A version of Excel with your data entered in a worksheet. These instructions are for Microsoft Excel for Microsoft 365 on Windows; the same functions work in Excel for Mac and Excel for the web.
  • A column or row of numeric observations. Keep a heading, if you have one, outside the selected range when possible.
  • A decision about whether the data is a sample or a complete population. This determines which function to use.

Step-by-Step

  1. Put the observations in a single range. Enter each measured value in its own cell, such as B2 through B9. Keep the values together in one column or row so the range is easy to select and review. You can include a heading in B1, but use B2:B9 in the formula so the range clearly contains only the observations. Avoid putting totals or unrelated numbers in the middle of the data. A blank cell is usually ignored, but it is better to check why it is blank before calculating.
  2. Decide whether your values are a sample or a population. Use STDEV.S when you measured some members of a larger group and want to estimate variability in that group. For instance, eight products selected from a production run are a sample. Use STDEV.P when your data contains every member of the group you are describing, such as the scores of every student in a small class. The distinction matters because STDEV.S adjusts for estimating from a sample and generally returns a slightly larger value than STDEV.P for the same data.
  3. Select an empty cell for the answer. Click a blank cell away from the source values, such as D2. Keeping the result separate makes it easier to see whether the calculation is correct and prevents you from accidentally including the answer in your data range later. You can add a nearby label such as “Sample standard deviation” or “Population standard deviation” so someone reviewing the worksheet knows what the number represents.
  4. Enter the sample formula if your data is a sample. With the observations in B2:B9 and the answer cell D2, type =STDEV.S(B2:B9) in D2 and press Enter. Excel calculates the sample standard deviation and displays the result in D2. You can type the range directly or select it with the mouse after entering the opening parenthesis. Confirm that the highlighted range starts and ends on the intended observations before pressing Enter.
  5. Enter the population formula if the data is complete. With all population values in B2:B9 and the answer cell D2, type =STDEV.P(B2:B9) in D2 and press Enter. Do not choose the population function simply because the list looks large; use it only if the list contains the entire group you want to describe. If the records are a selection from a broader group, STDEV.S is typically the appropriate choice.
  6. Check the result and label it. Compare the result with the scale and spread of the original values. Standard deviation is expressed in the same units as the data, so a result of about 2 for measurements in centimeters means a typical spread of a few centimeters around the average. It is not a percentage unless you separately convert it. Add a label beside the answer and, if useful, format the result with a reasonable number of decimal places using Home > Number. Changing the displayed decimal places affects appearance, not the underlying calculation.

For a quick check, suppose B2:B9 contains 2, 4, 4, 4, 5, 5, 7, and 9. The mean is 5, and the sum of the squared differences from that mean is 32. With those values in B2:B9 and the result in D2, =STDEV.P(B2:B9) returns 2 because it divides 32 by 8 before taking the square root. With the same values and layout, =STDEV.S(B2:B9) returns approximately 2.1381 because it divides 32 by 7. This example is a useful way to confirm that you selected the intended function.

Excel for Mac and Excel for the web use the same STDEV.S and STDEV.P formulas. In Excel for the web, enter the formula in a cell and press Enter as you would on the desktop. On Mac, the formula syntax is also the same; ribbon layout and keyboard shortcuts can differ, but no special menu command is required for this calculation.

Common Mistakes

  • Choosing the wrong function. Using STDEV.P for a sample can understate the estimated spread. Using STDEV.S for a complete population gives a slightly higher result than the population calculation. Think about what group the values represent, not how many values are present.
  • Selecting the wrong cells. A range that leaves out an observation or includes a nearby unrelated number changes the answer. Click the formula cell and inspect the range shown in the formula bar. If you added values after entering the formula, check whether the range includes the new rows.
  • Including a total or summary value as an observation. A sum, average, or subtotal is not another measurement. If it falls inside the selected range, Excel treats it as data and the result may be misleading. Keep summaries outside the data range or adjust the formula range.
  • Confusing standard deviation with variance. Variance is measured in squared units, while standard deviation returns to the original units. If you need standard deviation, use STDEV.S or STDEV.P rather than a variance function.
  • Expecting text to count as zero. In a cell reference, text and blank cells are generally ignored by these functions; numeric zero is included as a real observation. Check whether a value that looks numeric is stored as text, because it may be skipped instead of included.

Tips

  • Use a clear label. State “sample” or “population” next to the result. A bare number is easy to misinterpret when a worksheet is shared or revisited later.
  • Keep raw data and calculations separate. Put observations in one area and results in another. This reduces the chance of including a formula result in its own input range and makes later updates simpler.
  • Use a table for data that will grow. In Excel, select the data and choose Insert > Table. A table can make a dataset easier to extend and manage. When you add rows, check that your standard-deviation calculation includes the newly added observations.
  • Inspect unusual values before removing them. A very high or low measurement can increase standard deviation, but it may be a genuine observation. Verify the source record and correct only confirmed errors; do not delete a value solely because it changes the result.
  • Keep precision in mind. Excel stores more precision than it may display. Formatting a result to show two decimal places does not round the stored answer used in later calculations. If a downstream calculation requires a rounded value, decide deliberately whether to round it in a separate formula.

Troubleshooting

The cell displays #DIV/0!. STDEV.S needs at least two numeric observations to estimate sample variability. Check that the selected range contains at least two numbers and that values stored as text are converted to numbers. STDEV.P can calculate a population standard deviation from one numeric observation, which is zero, but it cannot calculate a meaningful result if there are no numeric values.

The result is zero. If all included numbers are identical, zero is the correct standard deviation: there is no variation in the values. If that seems unlikely, inspect the source range for repeated values, text-formatted numbers, or an accidentally selected single cell.

The result is much larger or smaller than expected. Verify the start and end of the range, confirm that you chose the right sample or population function, and look for an outlier, a total, or a value in different units. Also check that the decimal separator and cell contents were entered as intended. One value recorded in thousands while the rest are recorded in units can greatly affect the result.

Excel shows the formula as text instead of calculating it. Make sure the entry starts with an equals sign and that the cell is not formatted as Text. Change the cell format to General, then re-enter the formula. If the formula was preceded by an apostrophe, remove it. In some regional settings, Excel may expect semicolons rather than commas between function arguments; use the separator accepted by your installation if the comma version produces a syntax warning.

The formula returns an unexpected error. Check for misspelled function names, unmatched parentheses, or a range reference that points to the wrong cells. Error values inside the referenced cells can also flow into the result. Correct or investigate the source error rather than hiding it, so the final statistic remains traceable.

Frequently Asked Questions

Should I use STDEV.S or STDEV.P?
Use STDEV.S when your numbers are a sample from a larger group. Use STDEV.P when they include every member of the group you are describing. The right choice depends on how the data was collected, not on which formula gives a preferred result.

What is the difference between standard deviation and average?
The average describes the center of the values. Standard deviation describes how spread out they are around that center. Two datasets can have the same average but different standard deviations if one has values more widely dispersed.

Can I calculate standard deviation for values in different columns?
Yes. The function can accept multiple ranges or individual values, but make sure every included cell is an observation from the same dataset and uses compatible units. For a beginner, placing the data in one continuous range makes the inputs easier to audit.

Do blank cells affect standard deviation in Excel?
Blank cells in a referenced range are ignored, while numeric zero is counted. If a blank means that a measurement is missing, do not replace it with zero unless zero is the actual measured value; doing so changes the statistic.

Can I use the old STDEV function?
Excel retains STDEV for compatibility with older workbooks, but Microsoft recommends STDEV.S for sample data. Use STDEV.P for population data so the function makes your assumption explicit to anyone reading the formula.

Does standard deviation tell me whether a dataset is good or bad?
No. It measures spread, not data quality or whether a result is desirable. Interpret it alongside the units, context, data collection method, and the question you are trying to answer.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.