Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Formula for Standard Deviation

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You can calculate standard deviation in Excel using the STDEV.S function for sample data or STDEV.P for population data. The formula syntax is =STDEV.S(number1, [number2], ...) or =STDEV.P(number1, [number2], ...), where you reference the cells containing your data values.

What You'll Need

  • A computer with Microsoft Excel installed (2010 or later versions are recommended for the most stable function availability).
  • A dataset containing the numbers you want to analyze. These can be entered directly into cells, or pulled from another worksheet or table.
  • Familiarity with basic Excel cell referencing (like A1, B2:C5) is helpful, though not strictly required to type the formula.

Step-by-Step

  1. Select the cell where you want the result to appear. Click on any empty cell in your spreadsheet where you would like the standard deviation value to be displayed. This cell will hold the final calculated number.
  2. Type the equals sign (=). Begin typing the formula by pressing the equals key on your keyboard. This signals to Excel that you are entering a calculation rather than just plain text. Type the opening parenthesis (.
  3. Type the function name. Enter STDEV.S if your data represents a sample, or STDEV.P if your data represents the entire population. You can also type STDEV (without the letter) if you are using a very recent version of Excel, which will automatically default to the sample calculation, but using the full name STDEV.S is clearer.
  4. Select your data range. Highlight the cells containing the numbers you want to analyze. You can do this by clicking and dragging your mouse over the range, or by typing the cell references manually (e.g., A1:A10). Ensure you do not include any headers, labels, or text cells in this range.
  5. Close the parenthesis and press Enter. Type the closing parenthesis ) and then press the Enter key on your keyboard. Excel will now calculate the standard deviation based on the numbers in your selected range and display the result in the cell you selected in step one.
  6. Optional: Copy the formula to other cells. If you have multiple columns of data and want to calculate the standard deviation for each one, you can click on the cell with your formula, hover your mouse over the small square in the bottom-right corner of the cell (the fill handle), and drag it down to the other cells. Excel will automatically adjust the cell references for each column.

Common Mistakes

One of the most frequent errors when calculating standard deviation is using the wrong function. Excel offers several variations of the function, and selecting the wrong one can lead to significantly different results. STDEV.S is used when your data is a subset of a larger group (a sample). STDEV.P is used when you have data for the entire group you are interested in (a population). Using STDEV.P on a sample will underestimate the true variability of the data, while using STDEV.S on a population will overestimate it. If you are unsure which one to use, STDEV.S is generally the safer default because most real-world data sets are samples of a larger population.

Another common mistake is including non-numeric data in the range. Standard deviation is a statistical measure of numeric dispersion. If your range includes text, blank cells, or logical values (like TRUE or FALSE), Excel will ignore the text, but it may also ignore the blank cells if they are not handled correctly, potentially skewing your sample size count. Always ensure your data range contains only numbers.

Tips

For better readability and to avoid errors, it is often helpful to name your data ranges. Instead of referencing a long range like B2:B100, you can define a name. Go to the Formulas tab in the ribbon, click on Define Name, and give your range a meaningful name, such as QuarterlySales. You can then use this name directly in your formula: =STDEV.S(QuarterlySales). This makes the formula much easier to read and less prone to typos when ranges are moved or copied.

When working with large datasets, it can be useful to add conditional formatting to highlight outliers. Standard deviation is heavily influenced by extreme values (outliers). If you find that your standard deviation is very high, visually inspect your data to see if there is a single value that is dragging the average up. You can use the built-in Conditional Formatting > Highlight Cells Rules > Greater Than to shade any cell that is more than two or three standard deviations away from the mean.

Troubleshooting

If your formula returns a #DIV/0! error, it means the standard deviation cannot be calculated because there are not enough data points. Standard deviation requires at least two numeric values to calculate variance. If you have only one number in your range, Excel will return this error. Check your data range to ensure you have selected at least two cells containing numbers.

If the result looks incorrect or you are seeing the #VALUE! error, check if your range contains text or mixed data types. As mentioned earlier, standard deviation functions only work with numbers. If you have accidentally selected a header row that contains text labels, you must remove those labels from your range before calculating the standard deviation. You can verify your data by looking at the bottom status bar in Excel; if the count of numbers is different from the count of all cells in your range, you likely have non-numeric data included.

Frequently Asked Questions

What is the difference between STDEV.S and STDEV.P?

The difference lies in how the denominator is calculated. STDEV.S uses the sample size minus one in the denominator (n-1), which is the unbiased estimator of the population variance. STDEV.P uses the actual population size in the denominator (n). Use STDEV.S if you have a sample; use STDEV.P if you have the entire population.

Why is my standard deviation zero?

A standard deviation of zero indicates that all the numbers in your dataset are identical. There is no variation or spread among the values. For example, if you have a list of numbers all equal to 10, the standard deviation will be zero.

Can I use the STDEV function instead of STDEV.S?

In very recent versions of Excel, the simple STDEV function exists and defaults to the sample calculation (STDEV.S). However, for compatibility and clarity across all versions, it is recommended to use the explicit STDEV.S function to ensure you are using the sample method.

Does the standard deviation include the average in the calculation?

No, the standard deviation does not include the average (mean) in the calculation. It measures how far individual data points are from the mean, but it does not include the mean value itself as a data point in the set.

How do I calculate standard deviation for a filtered list?

The standard deviation functions in Excel only calculate based on the visible cells. If you have applied a filter to your data and you want the standard deviation of only the visible rows, you can simply select the visible cells and type your formula. However, if you want the standard deviation of the unfiltered data, you must either remove the filter or use the AGGREGATE function with the option to ignore hidden rows.