Standard Deviation in Excel — Complete Guide (2026)
Standard deviation Excel formula explained: STDEV.S, STDEV.P, STDEVA, sample vs population, syntax, examples, and common errors. Step-by-step guide.

Standard Deviation in Excel — Every Function That Actually Matters
Short answer first. The standard deviation Excel formula you want most of the time is =STDEV.S(A2:A100). Press Enter. That's it. But there's a catch — STDEV.S is for samples, not whole populations, and picking the wrong one quietly skews your numbers. This guide walks through all the variants, when to use each, and the exact syntax that works in Excel 2010 through Microsoft 365.
Most Excel certification questions about statistics circle back to standard deviation. Quality control charts, exam score analysis, stock volatility, manufacturing tolerances — they all need either STDEV.S or STDEV.P, and knowing which is which earns easy points on the Microsoft Office Specialist exam. Want practice questions on this exact topic? The excel practice test covers statistical functions in detail.
Here's the thing nobody tells you upfront. STDEV still exists as a legacy function and behaves identically to STDEV.S. Microsoft kept it for backwards compatibility but officially recommends the newer dot-syntax version starting in Excel 2010. Same answer, cleaner naming. You'll see both in older workbooks, so it helps to recognize the relationship.
The math itself is unchanged from grade-school stats class. Standard deviation measures how spread out your data is around the mean. A small standard deviation means values cluster tightly. A large one means they scatter widely. The square root of variance, in formula terms. Excel just handles the arithmetic so you don't have to write the summation by hand. If you're brand-new to formulas, start with the how to use excel basics, then come back.
Worth knowing upfront: every function below works in Excel 2010, 2013, 2016, 2019, 2021, Microsoft 365, and Excel for the web. The .S and .P suffix variants were added in Excel 2010 — if you're still on Excel 2007 or earlier, you're stuck with STDEV and STDEVP (no dot). Same math, older names.
Why does the sample-versus-population distinction matter so much? Because the denominator changes. Sample standard deviation divides by n minus 1. Population divides by n. With a small dataset, that one-unit difference can shift your answer by 5 to 15 percent. Pick the wrong function on a 10-row dataset and your quality control chart misses defects you should have caught. Every applied stats problem in Excel rests on getting this choice right.
Standard Deviation by the Numbers

Five Standard Deviation Functions in Excel
Use =STDEV.S(A2:A100) when your data is a sample drawn from a larger population. Divides by n minus 1. This is the default choice for survey data, test scores from a subset of students, and quality samples pulled from production runs.
Use =STDEV.P(A2:A100) when your data covers the entire population. Divides by n. Pick this when you have every employee's salary, every test score in a class, or every transaction from a single day.
Like STDEV.S but counts text values as zero and logical TRUE as 1, FALSE as 0. Useful when missing data is marked as text labels instead of left blank. Otherwise treats numbers identically to STDEV.S.
Population variant that includes text and logicals. Counts text as zero and logical TRUE as 1, FALSE as 0. Rarely used outside specific data import scenarios where blanks were filled with text placeholders.
The original function from Excel 2007 and earlier. Behaves identically to STDEV.S — same n minus 1 denominator, same result. Microsoft kept it for backwards compatibility but recommends STDEV.S in new workbooks.
Legacy population variant equivalent to STDEV.P. Still works in modern Excel for old workbook compatibility. New formulas should use STDEV.P instead — same answer, cleaner naming convention.
Method 1: STDEV.S — The Sample Standard Deviation
This is the function you'll use 90 percent of the time. Type an equals sign, type STDEV.S, open parenthesis, select your range, close parenthesis, press Enter. =STDEV.S(B2:B25) returns the standard deviation of the 24 values in column B. Excel does all the arithmetic — subtracts the mean, squares the differences, averages by n minus 1, and takes the square root in one shot.
Use STDEV.S when your data represents a sample of a larger population. Sampling 50 customer survey responses out of 10,000 customers? Sample. Measuring 30 widgets from a production run of millions? Sample. Test scores for one classroom of 25 students when you care about the whole school district? Still a sample. The n minus 1 divisor (called Bessel's correction) compensates for the fact that small samples tend to underestimate the true spread of the full population.
The function ignores blank cells and text values silently. =STDEV.S(A1:A100) on a column that has numbers scattered across only 60 of those cells still returns the correct standard deviation for those 60 numbers. The other 40 blank cells don't contribute to the count or the math. This is helpful when working with sparse datasets, like incomplete excel pivot tables exports where some categories have fewer data points than others.
One trap: STDEV.S throws #DIV/0! if you give it fewer than two numeric values. A sample of one has zero degrees of freedom — there's nothing to measure spread against. Always have at least two data points before using STDEV.S. For single-value ranges, the answer is technically undefined and Excel correctly refuses to invent one.
Need a quick mental check that your result makes sense? For roughly bell-shaped data, about 68 percent of values fall within one standard deviation of the mean, and 95 percent within two. If your range of values is 100 to 200 (spread of 100) but STDEV.S returns 80, something is off — you likely have outliers skewing the math. Three standard deviations should cover almost everything in normal data.
Method 2: STDEV.P — Population Standard Deviation
=STDEV.P(A1:A50) divides by n instead of n minus 1. Use it when your data is the entire population, not a sample. Every employee in the company, every product in inventory, every game played by a team this season — these are populations because you have all the data, not just a slice.
The difference between STDEV.S and STDEV.P shrinks as your sample size grows. On 10 values, the gap is around 5 percent. On 100 values, less than 1 percent. On 10,000 values, the difference is so small it doesn't matter for most practical purposes. But on small samples the denominator choice is significant — wrong function on a 10-row dataset can shift your answer by 5 to 15 percent and that's enough to flip a quality control pass into a fail.
A common mistake: people grab STDEV.P because the formula looks simpler in their head (dividing by n is just averaging), but their data is actually a sample. The right rule of thumb — if your data is a slice meant to represent something bigger, use STDEV.S. If your data IS the whole thing, use STDEV.P. When in doubt, STDEV.S is the safer pick because the n-1 correction widens the estimate slightly, which errs on the side of caution.
For exam prep, memorize this single sentence: STDEV.S is sample with n-1, STDEV.P is population with n. That's it. Every Excel certification question on standard deviation tests whether you can pick the right one from a word problem.
STDEVA, Confidence Intervals, and Standard Error
=STDEVA(A1:A20) behaves like STDEV.S except it counts text cells as zero and logical TRUE as 1, FALSE as 0. Useful when imported data marks missing values with words like "N/A" or "NULL" — those text entries get treated as zeros and pulled into the calculation, often dramatically increasing the spread.
In practice, STDEVA is rarely the right answer. Most analysts want missing values excluded, not counted as zeros. If you see STDEVA pulling weird results, switch to STDEV.S and clean the text values out of your range first using IFERROR or a filtered table.
STDEV.S vs STDEV.P — Which Should You Use?
- +STDEV.S is the right choice for survey data and any subset of a larger population
- +STDEV.S applies Bessel's correction (n-1) for unbiased sample estimation
- +STDEV.S is the default in academic statistics courses worldwide
- +STDEV.S returns slightly larger values on small samples, which is the safer estimate
- +STDEV.P is correct when you have data for every member of a defined group
- +STDEV.P returns the exact mathematical standard deviation when n is the full set
- −STDEV.S can overestimate spread on very small samples (under 10 values)
- −STDEV.S throws #DIV/0! with only one data point — sample of one has no degrees of freedom
- −STDEV.P understates true variability when used incorrectly on samples
- −STDEV.P difference vs STDEV.S becomes negligible at n above 1000
- −Neither function flags whether your data actually meets normality assumptions
- −Both functions ignore text and blanks silently — easy to miss data quality issues

Standard Deviation Quick Reference Checklist
- ✓Sample data? Use =STDEV.S(range) — divides by n minus 1
- ✓Full population? Use =STDEV.P(range) — divides by n
- ✓Text in cells? STDEVA counts text as zero; STDEV.S ignores it
- ✓Need confidence interval? CONFIDENCE.T(0.05, STDEV.S, COUNT)
- ✓Standard error? STDEV.S/SQRT(COUNT) — no dedicated function
- ✓Square root of variance equals standard deviation
- ✓Excel 2007? Use STDEV (no dot) — same as STDEV.S
- ✓Range under 2 numbers? STDEV.S returns #DIV/0!
- ✓Outliers? Check with quartiles before trusting STDEV result
- ✓Conditional STDEV? Array formula with IF or FILTER in 365
Standard Deviation Is Just sqrt(Variance)
Excel has separate functions for variance: VAR.S (sample) and VAR.P (population). Standard deviation is literally the square root of variance. So =SQRT(VAR.S(A1:A100)) returns the exact same answer as =STDEV.S(A1:A100). The functions are paired for a reason — variance is in squared units (squared dollars, squared inches), which is awkward to interpret. Standard deviation converts it back to the original units, which is why analysts almost always report STDEV instead of VAR.
Practical Examples — Where Standard Deviation Pays Off
Three industries lean on standard deviation daily. First, stock market analysts measure volatility as the standard deviation of daily returns over a period. A stock with low STDEV is stable; one with high STDEV swings hard. The Sharpe ratio (return divided by standard deviation) is a core finance metric built directly on STDEV.S of returns. Type =STDEV.S(B2:B253)/AVERAGE(B2:B253) across a year of daily returns and you have a quick volatility score.
Second, manufacturing quality control. Pull a sample of 30 widgets from a production line, measure each, and run =STDEV.S(measurements). Compare the result against your specification tolerance. If STDEV is wider than the tolerance allows, your process is out of control. Six Sigma methodology is built on this — its name literally refers to keeping defects within six standard deviations of the mean, which equals 3.4 defects per million opportunities.
Third, education and testing. Standardized test scores are reported with standard deviation so individual scores can be normalized. An SAT raw score of 1300 means more in a year when the STDEV was 150 than when it was 200 — the same raw number represents different percentiles. Excel teachers use this to grade on a curve: anyone above the mean plus one standard deviation gets an A, anyone between mean and mean-plus-one gets a B, and so on. Tools like countifs excel work well alongside STDEV to break down score distributions.
Real estate pricing uses STDEV.S to compute neighborhood comparables. Pull 20 recent sales of similar homes, run STDEV.S, and any individual price more than two standard deviations from the mean is flagged as an outlier — either a steal or a problem. Appraisers use this to defend valuations against challenges.
Healthcare uses STDEV for lab result reference ranges. Normal cholesterol is defined as the population mean plus or minus two standard deviations. Anything outside that range is flagged for follow-up. The cutoff numbers in every lab report you've ever seen came from someone running STDEV.P on a large reference population dataset.
Even sports analytics. Baseball batting averages over a season are evaluated against the STDEV of the league. A player batting .280 in a season where league STDEV was .025 is more impressive than .280 when STDEV was .040 — the player exceeded the mean by more standard deviations. The same math underpins fantasy sports projections and player valuations.
Standard deviation is highly sensitive to outliers because it squares the differences from the mean. A single extreme value can double your STDEV result on a small dataset. Before trusting any STDEV number, scan your range with =MAX(range) and =MIN(range) for impossible values. Better yet, run =QUARTILE(range,1) and =QUARTILE(range,3) to find the interquartile range — values more than 1.5 times the IQR beyond Q1 or Q3 are statistical outliers and may need to be excluded before computing STDEV.
Conditional Standard Deviation and Power Query
There's no built-in STDEVIF function — Microsoft never shipped one. To compute standard deviation matching a condition, you build it manually. In Excel 365, the cleanest approach is FILTER: =STDEV.S(FILTER(B2:B100, A2:A100="East")) returns the STDEV of values in column B where column A equals "East". One formula, no helper column, dynamic when source data changes.
On older Excel versions, you need an array formula with IF. {=STDEV.S(IF(A2:A100="East", B2:B100))} entered with Ctrl+Shift+Enter does the same job. Excel wraps the formula in curly braces automatically — don't type those yourself. The legacy array syntax still works in Excel 365 too, but FILTER is faster to read.
For multiple conditions, nest the FILTER calls or combine logical operators. =STDEV.S(FILTER(B2:B100, (A2:A100="East")*(C2:C100>50))) gives you STDEV of B where A is East AND C is greater than 50. The asterisk multiplies the two TRUE/FALSE arrays element-wise — both conditions must be true for the row to be included.
Power Query offers a no-formula alternative. Load your data into the Query Editor, group by your condition column, choose Standard Deviation as the aggregation, and click OK. Power Query generates the M code, you don't write any. The result lands in a new table that refreshes automatically when source data changes. For larger datasets where formula recalc gets slow, Power Query is significantly faster.
One quirk worth knowing: Power Query's Standard Deviation aggregation uses the sample formula (equivalent to STDEV.S, dividing by n minus 1). If you need population standard deviation in Power Query, you'll need to write custom M code with List.StandardDeviation and adjust the formula manually. That's the same reason — Microsoft assumes sample is the more common case across business analysts. To work with Power Query results back in cells, you may want a separate first and last name in excel step first if your data needs cleaning before aggregation.
PivotTables also expose standard deviation in the value field settings. Drop a numeric field into the Values area, click the dropdown, choose Value Field Settings, scroll to StdDev (sample) or StdDevP (population). Excel computes STDEV for each group in your PivotTable automatically. Useful for breaking down a large dataset by category without writing a single formula.
Common Errors and How to Fix Them
#DIV/0! is the most frequent STDEV error. STDEV.S returns it when your range has fewer than two numeric values. A sample of one has no degrees of freedom — n minus 1 equals zero, and the formula divides by zero. The fix is checking your range with =COUNT(A1:A100) first. If COUNT returns less than 2, your data is too thin for a sample standard deviation.
#NUM! appears with absurdly large datasets or extreme outliers that overflow Excel's numeric precision. Excel handles numbers up to about 1.79 × 10^308. Multiplying squared differences from a mean for millions of values can occasionally trigger overflow. The fix is converting to smaller units (work in thousands instead of raw dollars) before running STDEV.
#VALUE! sometimes appears with STDEVA when the range contains values Excel can't parse — usually dates stored as text or numbers stored as text with leading apostrophes. Fix by converting the column with =VALUE(A1) in a helper column, or by selecting the range and using Data → Text to Columns → Finish to force re-parsing.
Wrong answer with no error? Almost always a sample-vs-population mistake. Re-read the question carefully: is the data a subset or the entire group? If subset, use STDEV.S. If entire group, use STDEV.P. The error messages won't catch this — Excel happily returns the wrong answer if you picked the wrong function.
Another silent killer: hidden rows or filtered data. STDEV functions count all values in the range, including filtered-out rows. =STDEV.S(A2:A1000) includes the rows you filtered out of view. Use =AGGREGATE(7, 5, A2:A1000) instead — function number 7 is STDEV.S, option 5 ignores hidden rows. AGGREGATE is the filter-aware version of most statistical functions.
Numbers stored as text breaks STDEV silently. A column imported from CSV or pasted from a web page often looks like numbers but is actually text. STDEV.S ignores text values without warning — so your function runs successfully but on fewer values than you expected. The visual giveaway is a small green triangle in the cell's top-left corner. Select the column, click the warning icon, choose Convert to Number. The math now includes those values.
Locale settings cause one more category of issues. European Excel uses comma as the decimal separator. A formula copied from an English locale that worked as =STDEV.S(A1:A100) may need =STDEV.S(A1:A100) with semicolons depending on regional settings. Check File → Options → Advanced → Use System Separators if formulas show #NAME? errors after pasting from elsewhere.

Standard Deviation Audit Checklist
- ✓Verify COUNT returns at least 2 before trusting STDEV.S
- ✓Scan MIN and MAX for impossible outliers before reporting STDEV
- ✓Use AGGREGATE function 7 to ignore filtered rows in STDEV calculations
- ✓Convert text numbers to real numbers — STDEV.S silently skips them
- ✓Cross-check by running SQRT(VAR.S) — should match STDEV.S exactly
- ✓Confirm sample versus population by re-reading the data source description
When to Use Each Standard Deviation Function
Sample of customers, students, or products? STDEV.S. Every customer, every student, every product in the full set? STDEV.P. Imported data with text placeholders mixed in that you want counted as zeros? STDEVA. Stuck on Excel 2007 or older? STDEV and STDEVP without the dot. That's the entire decision tree.
Combining STDEV with other functions earns the most points on certification exams. =AVERAGE(A1:A30)+2*STDEV.S(A1:A30) gives you the upper bound of a 95-percent normal range — anything above that value is statistically unusual. =COUNTIF(A1:A30, ">"&(AVERAGE(A1:A30)+2*STDEV.S(A1:A30))) counts how many values exceed that upper bound. One formula chains five statistical concepts.
For exam prep specifically, master STDEV.S first, then STDEV.P, then how they combine with AVERAGE and CONFIDENCE.T. Those four functions cover roughly 95 percent of statistics questions on Microsoft Office Specialist exams, on Excel skills assessments used in hiring screens, and in the day-to-day workplace. STDEVA and STDEVPA show up rarely and only on advanced certifications.
The pattern that earns the most points on real exams: combining STDEV with COUNTIF, AVERAGE, and percentage formulas in one cell. =COUNTIF(A1:A100, ">"&(AVERAGE(A1:A100)+STDEV.S(A1:A100)))/COUNT(A1:A100) returns the percentage of values more than one standard deviation above the mean. That single formula tests AVERAGE, STDEV.S, COUNTIF, COUNT, and arithmetic — and it's the exact kind of nested formula that separates basic Excel users from people who get hired for analyst roles. Build the habit of nesting these together and you'll handle almost any statistics question that comes up.
Build the habit of sanity-checking every STDEV result. Put 1, 2, 3, 4, 5 in cells A1 through A5 and verify =STDEV.S(A1:A5) returns 1.5811 (and STDEV.P returns 1.4142). If your formula returns something else, the cells aren't pure numbers or your range is wrong. Five seconds of testing catches errors that would otherwise propagate through a financial model or quality control report and embarrass you in front of stakeholders.
Standard Deviation Use Cases by Industry
Stock volatility computed as STDEV.S of daily returns over a year. Sharpe ratio combines STDEV with average return for risk-adjusted performance. Portfolio optimization uses standard deviation to balance risk across asset classes — higher STDEV means higher swings.
Six Sigma quality control measures process capability in standard deviations. Tolerance limits are set as mean plus or minus three STDEV. Statistical process control charts plot moving averages with STDEV-based upper and lower bounds to catch drift before defects ship.
Grade-on-a-curve grading uses STDEV.S to set letter grade cutoffs. Standardized test scores publish mean and standard deviation so individual scores can be normalized to percentiles. SAT, ACT, and GRE all rely on STDEV-based score interpretation across cohorts.
Lab reference ranges (cholesterol, blood pressure, hormone levels) are defined as population mean plus or minus two STDEV. Clinical trial results report mean treatment effect with standard deviation. Drug dosing tables use STDEV to size doses against patient weight distributions.
F2 + F9 Previews Your Range Before Excel Computes It
One last shortcut worth bookmarking. Press F2 to edit a STDEV formula, then F9 to highlight just the range and see the evaluated array of values before Excel computes the standard deviation. Esc when you are done — this lets you preview what data is feeding into your formula without committing. Combine that with the Name Manager (Ctrl+F3) to assign meaningful names to your data ranges. =STDEV.S(MonthlyReturns) reads cleaner than =STDEV.S(B2:B253) and survives column insertions without breaking. Small workflow tweaks like these turn Excel from a calculator into a real statistical workbench you can actually trust under deadline pressure.
Excel Questions and Answers
About the Author
Business Consultant & Professional Certification Advisor
Wharton School, University of PennsylvaniaKatherine Lee earned her MBA from the Wharton School at the University of Pennsylvania and holds CPA, PHR, and PMP certifications. With a background spanning corporate finance, human resources, and project management, she has coached professionals preparing for CPA, CMA, PHR/SPHR, PMP, and financial services licensing exams.