Standard Deviation in Excel: STDEV Functions and Examples

Standard deviation in Excel — STDEV.S vs STDEV.P, sample vs population, syntax and examples, error handling, error bars in charts, and best practices.

Standard Deviation in Excel: STDEV Functions and Examples

Standard deviation in Excel measures how spread out a set of numbers is from their average value. A small standard deviation means values cluster tightly around the mean; a large standard deviation means values are spread widely. Excel offers several functions for calculating standard deviation depending on whether your data is a sample (a subset drawn from a larger population) or the entire population, and depending on whether you are using the modern function names introduced in Excel 2010 or the legacy names still supported for backward compatibility.

The two functions you will use most often are STDEV.S (sample standard deviation, modern) and STDEV.P (population standard deviation, modern). The syntax is simple: =STDEV.S(A1:A100) returns the sample standard deviation of the values in A1 through A100. =STDEV.P(A1:A100) returns the population standard deviation. The choice between sample and population depends on whether your data represents the entire group you care about or just a sample drawn from a larger group — most real-world Excel work uses sample standard deviation.

The legacy functions STDEV (sample) and STDEVP (population) are still available in modern Excel for backward compatibility with workbooks created before 2010. They produce identical results to the modern STDEV.S and STDEV.P. The convention in new workbooks is to use the modern dot-notation versions because the names are clearer about what they do. Both legacy and modern names work in Excel 2010 through Excel 365, on Windows, Mac and the web.

This guide explains every standard deviation function Excel offers, when to use sample versus population, the syntax and examples for each, the related variance functions (VAR.S, VAR.P), how to handle errors when data contains text or empty cells, how to graph standard deviation as error bars on charts, and how to interpret standard deviation in the context of the normal distribution. By the end you should know which function to reach for in any situation and why.

Standard deviation in 30 seconds

Use =STDEV.S(range) for sample standard deviation — the most common case. Use =STDEV.P(range) when your data represents the entire population, not a sample. Legacy STDEV and STDEVP still work but the dot-notation versions are clearer. Sample formulas divide by n-1 (Bessel's correction); population formulas divide by n. For variance use VAR.S or VAR.P (variance is just standard deviation squared).

The choice between sample and population standard deviation is the most important conceptual question in this topic. A population is the entire group you care about; a sample is a subset drawn from that population to estimate properties of the whole. If you have data on every student in a single class and you only care about that specific class, your data is the population — use STDEV.P. If you have data on 30 students from a school of 500 and you want to estimate the school's overall variation, your data is a sample — use STDEV.S.

The mathematical difference is in the divisor. Sample standard deviation divides the sum of squared deviations by n minus 1 (this is called Bessel's correction). Population standard deviation divides by n. The n-1 correction in the sample formula compensates for the fact that using the sample mean (rather than the true population mean) systematically underestimates variation. For small samples the difference is meaningful; for samples over a few hundred values the difference between STDEV.S and STDEV.P becomes negligible.

For most real-world Excel work, you should use STDEV.S. Test scores, measurement data, financial returns, survey responses, manufacturing samples — all are samples drawn from larger populations. Use STDEV.P only when you genuinely have data on the entire population (rare in practice) or when you have a specific reason to use the population formula. Statistical convention strongly favors sample standard deviation for nearly all inferential statistics work.

The output of STDEV.S or STDEV.P is a single number in the same units as your input data. If your input is heights in inches, the standard deviation is in inches. If your input is dollars, the standard deviation is in dollars. The standard deviation can be added to or subtracted from the mean to define ranges that contain certain percentages of the data — concepts central to the normal distribution and statistical inference.

Microsoft Excel - Microsoft Excel certification study resource

Excel standard deviation functions

functionSTDEV.S — sample (modern)

Returns the sample standard deviation of a range. The most commonly used function for real-world Excel work. Divides the sum of squared deviations by n minus 1 (Bessel's correction). Syntax: =STDEV.S(A1:A100). Available in Excel 2010 and later. Use this for nearly all standard deviation calculations on sampled data.

functionSTDEV.P — population (modern)

Returns the population standard deviation. Divides by n rather than n minus 1. Use only when your data represents the entire population, not a sample. Syntax: =STDEV.P(A1:A100). Available in Excel 2010 and later. Less commonly needed than STDEV.S because most real-world data is sampled rather than complete.

functionSTDEV / STDEVP (legacy)

Legacy function names still supported for backward compatibility with older workbooks. STDEV produces identical results to STDEV.S; STDEVP produces identical results to STDEV.P. New workbooks should prefer the modern dot-notation versions for clearer naming, but legacy versions continue to work in Excel 365 and earlier.

functionSTDEVA / STDEVPA

Variants that include text and logical values in the calculation, treating TRUE as 1, FALSE as 0 and text as 0. Rarely needed in practice — most standard deviation calculations operate on pure numeric data. Used in specialized cases where mixed-type data must be included in the dispersion calculation rather than ignored.

The basic syntax of STDEV.S takes one or more ranges or values as arguments. =STDEV.S(A1:A100) returns the standard deviation of A1 through A100. =STDEV.S(A1:A50, B1:B50) returns the standard deviation across both ranges combined. =STDEV.S(5, 7, 9, 11) returns the standard deviation of the four hardcoded values. The function accepts up to 255 individual arguments or ranges, treating empty cells, text and logical values as omissions rather than zeros (for STDEV.S; STDEVA includes them).

For data spread across multiple columns or sheets, use a single combined range or chain multiple ranges. =STDEV.S(A1:A100, C1:C100, E1:E100) computes the standard deviation across all three columns combined. Cross-sheet references work the same way: =STDEV.S(Sheet1!A1:A100, Sheet2!A1:A100) combines data from two sheets. If your data lives in an Excel Table, use the structured reference: =STDEV.S(Table1[Score]) computes the standard deviation of the Score column.

Variance is the square of standard deviation and Excel offers parallel functions: VAR.S for sample variance, VAR.P for population variance. =VAR.S(A1:A100) returns the sample variance. Variance is sometimes preferred in statistical analysis because it has cleaner mathematical properties, but standard deviation is generally easier to interpret because it is in the same units as the original data. Most reports and presentations use standard deviation rather than variance for that reason.

For computing standard deviation conditional on criteria, Excel does not have a direct STDEV.S.IF function but the same effect can be achieved with array formulas or helper columns. The simplest approach uses a helper column that filters the data based on criteria, then applies STDEV.S to the filtered range. More elegant approaches use array constructions that filter inside the formula itself — useful for one-off calculations where you do not want a helper column on the sheet.

Worked examples

You have test scores for 30 students in A1:A30. To compute the sample standard deviation: =STDEV.S(A1:A30). The result tells you how spread out the scores are around the average. A standard deviation of 8 on a 100-point test indicates relatively tight clustering; a standard deviation of 18 indicates more variation.

The normal distribution is where standard deviation gets its practical interpretation. For data that follows a normal (bell-shaped) distribution, approximately 68% of values fall within one standard deviation of the mean, 95% within two standard deviations, and 99.7% within three standard deviations. This 68/95/99.7 rule is the foundation for most statistical inference and quality control. The mean plus or minus 1.96 standard deviations contains 95% of the data — used in confidence intervals.

For data that does not follow a normal distribution, standard deviation still measures spread but the percentages are different. The Chebyshev inequality provides a more general bound: at least 1-1/k² of the data falls within k standard deviations of the mean, regardless of distribution shape. So for any distribution, at least 75% of data is within 2 standard deviations and at least 89% within 3 standard deviations. Looser bounds than the normal-distribution rule but applicable to non-normal data.

For exploratory data analysis, computing the mean and standard deviation together gives you the start of a distribution summary. Add the minimum, maximum, median and quartiles to complete the picture. Excel's QUARTILE.INC function returns the quartiles of a range. The five-number summary (min, Q1, median, Q3, max) plus mean and standard deviation is the standard way to describe a distribution numerically before deciding what statistical methods to apply.

For visualizing standard deviation in charts, Excel's error bars feature is the standard tool. Click a chart, click the Plus icon at top-right, tick Error Bars and choose More Options. Set Error Amount to Custom, then specify positive and negative values from cells containing your standard deviation calculation. The error bars appear above and below each data point. This is the standard way to present uncertainty visually in scientific and business reports.

Excel Spreadsheet - Microsoft Excel certification study resource

For data that includes text or empty cells mixed with numbers, the default behavior of STDEV.S is to skip the non-numeric values. This is usually what you want — empty cells should not contribute zero artificially, and text cells should not contribute either. If you do want text and logical values included (with text and FALSE counted as 0, TRUE as 1), use STDEVA instead. The choice depends on what the non-numeric values represent in your data set.

For numeric values stored as text (a common Excel data quality issue), the values are skipped by STDEV.S even though they look numeric on screen. To fix, convert the text-numbers to actual numbers using VALUE() or by running Data > Text to Columns and finishing the wizard immediately to force a re-parse. Once the cells are actually numeric, STDEV.S includes them in the calculation correctly.

For very large datasets, performance becomes a consideration. STDEV.S on a range of 1 million cells recalculates instantly on modern hardware. STDEV.S inside an array formula filtering a million-cell range can take seconds to recalculate. For analytical work on huge datasets, Power Query or Power Pivot is faster than worksheet formulas — load the data, compute aggregates and load results back to the worksheet.

For statistical analysis beyond basic standard deviation, Excel offers a comprehensive suite of statistical functions including CONFIDENCE.NORM and CONFIDENCE.T for confidence intervals, NORM.DIST and NORM.INV for normal distribution calculations, T.TEST for hypothesis testing, CORREL for correlation coefficients and many others. The Data Analysis ToolPak (Add-Ins > Analysis ToolPak) provides additional menu-driven statistical analysis that complements the formula-based functions.

Standard deviation best practices

  • Use STDEV.S for sample data (most common case)
  • Use STDEV.P only when data represents the entire population
  • Prefer modern dot-notation function names over legacy names
  • Verify range contains at least 2 numeric values
  • Convert text-numbers to actual numbers before computing
  • Wrap with IFERROR() if the range may produce #DIV/0!
  • Annualize daily financial returns by SQRT(252)
  • Use error bars in charts to visualize standard deviation
  • Combine with mean for the standard distribution summary

For combining mean and standard deviation in formulas, the typical pattern computes both together: =AVERAGE(A1:A100) for the mean, =STDEV.S(A1:A100) for the standard deviation. Display them side by side in a summary panel — mean ± standard deviation is the standard way to summarize a distribution in scientific reporting. For quick reference, =CHOOSE(1, AVERAGE(A1:A100), STDEV.S(A1:A100)) does not work directly but using two adjacent cells is straightforward and more readable.

For confidence intervals around the mean, the standard formula combines the mean, standard deviation and sample size. The 95% confidence interval for the mean is approximately mean ± 1.96 × (standard deviation / SQRT(n)) when the sample is large. =AVERAGE(A1:A100) + 1.96 * STDEV.S(A1:A100) / SQRT(COUNT(A1:A100)) gives the upper bound; subtract for the lower bound. For small samples (n < 30), use the t-distribution with T.INV.2T instead of the 1.96 normal critical value.

For z-scores (standardized values), the formula is (value - mean) / standard deviation. =(A1 - AVERAGE($A$1:$A$100)) / STDEV.S($A$1:$A$100) computes the z-score for the value in A1 relative to the distribution in A1:A100. Z-scores standardize values across different distributions for comparison and are the foundation for many statistical methods. Excel also has STANDARDIZE() that does this directly.

For outlier detection using standard deviation, a common rule of thumb is that values more than 2 or 3 standard deviations from the mean are outliers worth investigating. =IF(ABS(A1 - AVERAGE($A$1:$A$100)) > 3 * STDEV.S($A$1:$A$100), "Outlier", "Normal") flags values more than 3 standard deviations from the mean. Conditional formatting based on the same logic visually highlights outliers in your data.

For students learning statistics through Excel, the parallel between Excel functions and the formulas in your textbook is direct. The textbook formula for sample standard deviation is the square root of the sum of squared deviations divided by n minus 1. STDEV.S implements exactly this formula. Working through a few small examples by hand and verifying the result with Excel's STDEV.S builds confidence that you understand both the math and the Excel function. The textbook formula and the Excel result should match exactly for any small dataset.

For data analysts and finance professionals, standard deviation is a core daily metric. Stock volatility is just the annualized standard deviation of daily returns. Confidence intervals around forecasts use standard deviation. Process capability in manufacturing uses standard deviation. Risk-adjusted returns (Sharpe ratio) divide expected return by standard deviation. Across these domains, STDEV.S in Excel is the workhorse calculation behind nearly every formal analysis.

Excellence Playa Mujeres - Microsoft Excel certification study resource

Standard deviation quick reference

STDEV.SSample standard deviation (modern)
STDEV.PPopulation standard deviation (modern)
n − 1Divisor for sample formula
68 / 95 / 99.7%Normal distribution rule
SQRT(252)Annualization factor for daily returns
2010+Excel versions with dot-notation functions

Sample vs population — when to use which

usersSample (STDEV.S)

Use when your data is a subset drawn from a larger group you care about. Survey responses, test scores in one class for inferring about all classes, daily stock returns for inferring future volatility, manufacturing samples to estimate process variation. The vast majority of real-world Excel work falls into this category.

globePopulation (STDEV.P)

Use only when your data represents the entire group you care about. Census data on every household in a small village, every transaction in a complete business year for that specific year, complete population data with no broader inference. Less common in practice because most data is sampled rather than complete.

trending-upVariance functions

VAR.S returns sample variance; VAR.P returns population variance. Variance is the square of standard deviation. Used in statistical analysis where mathematical properties matter (variance is additive across independent variables; standard deviation is not). Standard deviation is more interpretable; variance is more useful in derivations.

listMixed-type variants

STDEVA includes text and logical values (text and FALSE as 0, TRUE as 1). STDEVPA is the population equivalent. Rarely needed in practice — most standard deviation calculations operate on numeric-only data. Used when mixed-type data must be included in dispersion rather than skipped, an unusual analytical requirement.

For the workbook that will be shared with users on different Excel versions, the modern dot-notation functions (STDEV.S, STDEV.P) work in Excel 2010 and later. Workbooks targeting Excel 2007 or earlier should use the legacy STDEV and STDEVP names for compatibility. Excel 2007 is rarely encountered in 2026, so the modern names are essentially universal in current practice. New workbooks should always use the dot-notation versions for clarity.

For Excel for the web users, all standard deviation functions work normally with no version-specific limitations. The web version of Excel supports STDEV.S, STDEV.P, STDEV, STDEVP, STDEVA and STDEVPA along with their VAR counterparts. Calculations performed in the web version produce identical results to the desktop version. The web version is fully sufficient for any standard deviation calculation a typical analyst would need.

For users transitioning from older Excel versions or from Google Sheets, the standard deviation function names differ slightly across platforms. Google Sheets uses STDEV (sample) and STDEVP (population) and supports STDEV.S and STDEV.P as Excel-compatibility aliases. LibreOffice Calc uses the same function names as Excel including the modern dot-notation. The conceptual model — sample versus population, divisor of n minus 1 versus n — is identical across all spreadsheet applications, only the function names vary.

For VBA scripting in Excel, the equivalent is Application.WorksheetFunction.StDev_S(range) for sample standard deviation. The legacy Application.WorksheetFunction.StDev(range) also works for backward compatibility. The dot in Excel function names becomes an underscore in the VBA WorksheetFunction object naming. Power Query M language uses List.StandardDeviation(list) which defaults to sample standard deviation, similar to Excel's modern convention.

For reporting standard deviation in business documents and presentations, the typical format is mean plus or minus standard deviation in the same units. Average response time was 4.2 plus or minus 1.1 seconds tells the reader both the central value and the typical spread around it. Some reports use coefficient of variation (CV equals standard deviation divided by mean, expressed as a percentage) when comparing variation across measurements with different scales. CV near zero means tight clustering; CV near 1 or above means high relative variation.

EXCEL Questions and Answers

About the Author

James R. HargroveJD, LLM

Attorney & Bar Exam Preparation Specialist

Yale Law School

James R. Hargrove is a practicing attorney and legal educator with a Juris Doctor from Yale Law School and an LLM in Constitutional Law. With over a decade of experience coaching bar exam candidates across multiple jurisdictions, he specializes in MBE strategy, state-specific essay preparation, and multistate performance test techniques.