Excel Practice Test

โ–ถ

Standard Deviation in Excel: Which Function to Use

Standard deviation measures how spread out values are from the average. A small standard deviation means values cluster tightly around the mean; a large one means they are dispersed widely. In Excel, calculating it takes a single function โ€” but choosing the right function matters, because Excel offers six standard deviation functions and picking the wrong one produces a subtly incorrect result.

The function you will use most often is STDEV.S, which calculates standard deviation for a sample โ€” a subset of a larger population. If you have test scores from 30 students in one class and want to infer how spread out scores are across all students at the school, you use STDEV.S because your 30 scores are a sample of the population. If instead you have scores from every student at the school and want to measure the spread of that complete group, you use STDEV.P (population standard deviation).

The distinction matters statistically because sample standard deviation uses n-1 in its denominator (Bessel's correction) while population standard deviation uses n. For large datasets the difference is negligible, but for small samples it produces meaningfully different results. As a practical rule: almost every business and academic dataset is a sample, not a complete population, so STDEV.S is the default choice.

Excel also retains the legacy functions STDEV (identical to STDEV.S) and STDEVP (identical to STDEV.P) for backward compatibility, plus STDEVA and STDEVPA which treat text and logical values as numbers rather than ignoring them. Understanding these variants prevents errors when working with mixed-type data or with spreadsheets built by other users who may have used the older function names.

There is also an important distinction between standard deviation and standard error, which are sometimes confused. Standard deviation describes the spread of data within your dataset โ€” how much individual values vary around the mean. Standard error of the mean (SEM) measures how precisely your sample mean estimates the true population mean, and it decreases as sample size increases.

Standard error is calculated as standard deviation divided by the square root of the sample size: =STDEV.S(range)/SQRT(COUNT(range)). In scientific and medical reporting, error bars on charts more often show standard error than standard deviation, so knowing which measure is being displayed matters for interpreting results correctly.

  • STDEV.S โ€” Sample standard deviation (ignores text and logical values)
  • STDEV.P โ€” Population standard deviation (ignores text and logical values)
  • STDEVA โ€” Sample SD including text as 0 and TRUE/FALSE as 1/0
  • STDEVPA โ€” Population SD including text and logical values
  • STDEV โ€” Legacy alias for STDEV.S (still works, not recommended for new formulas)
  • STDEVP โ€” Legacy alias for STDEV.P (still works, not recommended for new formulas)
STDEV.S
Function for most datasets (sample)
STDEV.P
Only when you have the full population
n-1
Denominator in sample SD (Bessel's correction)
68%
Data within 1 SD of mean (normal dist.)
95%
Data within 2 SD of mean (normal dist.)
Z-score
Deviations from mean in SD units

STDEV.S Syntax, Examples, and Common Errors

The STDEV.S function syntax is: =STDEV.S(number1,[number2],...). You can pass up to 255 arguments, and each can be a single value, a cell reference, or a range. The most common form in practice is a single range: =STDEV.S(B2:B100).

STDEV.S ignores empty cells, text, and logical values (TRUE/FALSE) by default. If your range contains a mix of numbers and text labels, only the numeric values participate in the calculation. This is usually the right behavior โ€” but if you have data coded as text (numbers stored as text strings) in the range, they will silently be excluded, which distorts the result without showing an error. A quick way to check: format the column as Number; if any cells remain left-aligned, they contain text values, not numbers.

A common error is confusing STDEV.S with STDEV (the legacy function). Both calculate sample standard deviation and produce identical results, but Microsoft has deprecated STDEV in favor of STDEV.S. If you are writing a new spreadsheet, use STDEV.S. If you encounter STDEV in someone else's work, it is safe to leave it โ€” it will not produce an error โ€” but it is worth updating if you are doing a full audit.

Example โ€” Sales variability analysis: Suppose column B contains 52 weekly sales figures. =STDEV.S(B2:B53) tells you how much weekly sales deviate from the average. Combined with =AVERAGE(B2:B53), you can calculate the coefficient of variation: =STDEV.S(B2:B53)/AVERAGE(B2:B53). This ratio, typically expressed as a percentage, normalizes variability across datasets with different scales โ€” useful when comparing the consistency of sales in different regions or product lines.

Example โ€” Test score analysis: For a class assessment, =STDEV.S(C2:C31) gives the spread of 30 student scores. If the average is 72 and the standard deviation is 8, about 68% of students scored between 64 and 80 (within one standard deviation of the mean) under a normal distribution. About 95% scored between 56 and 88 (within two standard deviations). These ranges help identify students who are performing significantly above or below the class average. The full range of statistical and analytical functions used alongside standard deviation is in the Excel formulas guide.

For rank-based analysis, standard deviation complements percentile calculations. The PERCENTILE function returns the value at a given percentile position, while PERCENTRANK returns where a specific value falls percentile-wise. Together with standard deviation, these functions describe data distribution from multiple angles: how spread out it is (SD), where specific values fall (PERCENTRANK), and what value corresponds to a target percentile (PERCENTILE). For talent management, quality control, and performance benchmarking, combining all three gives a complete picture of distribution that a single metric cannot capture alone.

Running standard deviation calculations inside pivot tables also opens advanced options. When you add a field to the Values area of a pivot table, right-click it and select Value Field Settings.

The Show Values As tab lets you select Running Total, % of Grand Total, and other options, while the Summarize Values By tab includes StdDev (for STDEV.S equivalent) and StdDevp (for STDEV.P equivalent). This allows standard deviation to be calculated at each grouping level in the pivot without writing any formulas in the underlying data range โ€” one of the more powerful analytical features that is frequently overlooked in Excel pivot table training.

Another nuance: when your data range contains errors (such as #DIV/0! or #VALUE! cells), STDEV.S propagates the error and returns an error itself. The solution is to clean errors first or use an array approach. =STDEV.S(IF(ISNUMBER(B2:B100),B2:B100)) confirmed with Ctrl+Shift+Enter skips error cells. To calculate standard deviation only for a subset โ€” for example, rows where column A equals East โ€” use: =STDEV.S(FILTER(B2:B100,A2:A100="East")) in Excel 365. These conditional patterns are particularly useful for comparing variability across customer segments, product categories, or geographic regions without writing multiple separate formulas.

When to Use Each SD Function

๐Ÿ”ด STDEV.S

Use for samples โ€” any subset of a larger group. The correct choice for almost all business and academic data. Ignores text and empty cells.

๐ŸŸ  STDEV.P

Use only when your data IS the complete population โ€” every member, not a sample. Rare in practice. Returns a slightly lower value than STDEV.S for the same data.

๐ŸŸก STDEVA

Like STDEV.S but counts text values as 0 and TRUE as 1, FALSE as 0. Use when your data includes logical flags that should count as values.

๐ŸŸข STDEVPA

Population version of STDEVA. Includes text and logical values in the calculation. Very uncommon โ€” use only for specific mixed-data scenarios.

๐Ÿ”ต Legacy STDEV / STDEVP

Identical to STDEV.S and STDEV.P respectively. Safe to use but Microsoft recommends the newer .S and .P naming in all new formulas.

Visualizing and Using Standard Deviation in Charts

Calculating standard deviation is most useful when you visualize it alongside the data. Excel supports several approaches for making variability visible in charts and in the worksheet itself.

Error bars in charts โ€” Excel bar and line charts support error bars that show the standard deviation range above and below each data point. Select a chart, go to Chart Design, then Add Chart Element, then Error Bars, then More Error Bar Options. Choose Standard Deviation and set the multiplier (1 for one SD, 2 for two SDs). Error bars make it immediately clear which data points have high variability versus consistent performance.

Conditional formatting for outlier detection โ€” One of the most practical uses of standard deviation in Excel is highlighting outliers. Calculate the mean and standard deviation in separate cells, then apply a conditional formatting formula rule to the data range. The formula =$B2>$E$1+2*$F$1 highlights any value more than two standard deviations above the mean (where E1 holds the average and F1 holds the standard deviation). This flags statistical outliers โ€” values unusual enough to investigate. A full explanation of formula-based conditional formatting is in the conditional formatting guide.

Dynamic range highlighting โ€” You can use STDEV.S and AVERAGE together with conditional formatting to create a self-updating visual that always highlights outliers based on the current data range. Unlike static thresholds that break when data changes, dynamic formulas recalculate automatically as new data is added.

Bell curve visualization โ€” Excel does not have a built-in bell curve chart, but you can construct one using the NORM.DIST function to calculate density values across a range of x-values, then plot them as a line chart. For presentations where you need to show data distribution visually, this approach communicates spread more intuitively than a standard deviation number alone.

In financial analysis, standard deviation serves as a proxy for volatility. An investment with high standard deviation of returns is more volatile โ€” the returns swing widely from period to period. The Sharpe ratio, a standard risk-adjusted return metric, is calculated as (mean return minus risk-free rate) divided by standard deviation of returns: =(AVERAGE(returns)-riskFreeRate)/STDEV.S(returns). This formula is entirely buildable in Excel and is one of the most common formulas used in portfolio management and quantitative finance spreadsheets.

Standard Deviation by Use Case

๐Ÿ“‹ Business Analysis

Use STDEV.S for sales variability, quality control measurements, customer satisfaction scores, and financial performance metrics. Combine with AVERAGE to calculate coefficient of variation. Apply conditional formatting rules using AVERAGE+2*STDEV.S to flag performance outliers automatically in dashboards.

๐Ÿ“‹ Academic/Research

STDEV.S for sample data (test scores, survey responses, experimental measurements from a sample group). STDEV.P only when you have complete census data. Use STANDARDIZE to convert to Z-scores for cross-group comparisons. Combine with NORM.DIST for probability calculations and bell curve visualizations.

๐Ÿ“‹ Quality Control

Control charts use mean plus/minus 2 or 3 standard deviations as control limits. In Excel, calculate UCL (Upper Control Limit) as =AVERAGE+3*STDEV.S and LCL as =AVERAGE-3*STDEV.S. Points outside these limits signal process variation requiring investigation. This is the foundation of Statistical Process Control (SPC) analysis.

Advanced Statistical Applications: Z-Scores and Coefficient of Variation

Standard deviation is the foundation for several statistical measures that are useful in data analysis. Two of the most practical are Z-scores and the coefficient of variation.

Z-scores โ€” A Z-score expresses how many standard deviations a value is from the mean. The formula is: (value - mean) / standard deviation. In Excel: =(B2-AVERAGE($B$2:$B$100))/STDEV.S($B$2:$B$100). A Z-score of 0 means the value equals the mean. A Z-score of 2 means the value is two standard deviations above the mean โ€” statistically unusual in a normal distribution. Z-scores enable direct comparison of values from datasets with different scales or units, which is essential in multi-variable analysis. Excel's STANDARDIZE function performs the same calculation with cleaner syntax: =STANDARDIZE(B2,AVERAGE($B$2:$B$100),STDEV.S($B$2:$B$100)).

Coefficient of Variation (CV) โ€” The CV is standard deviation divided by the mean, expressed as a percentage. =(STDEV.S(B2:B100)/AVERAGE(B2:B100))*100. It measures relative variability and is most useful for comparing consistency across groups with different average values. A sales team averaging $50,000 per month with a CV of 8% is more consistent than one averaging $80,000 with a CV of 25%, even though the absolute standard deviation of the second team may be larger.

STDEV.S with multiple ranges โ€” You can pass multiple separate ranges to STDEV.S: =STDEV.S(B2:B50,D2:D50). This calculates standard deviation across all values from both ranges as if they were one continuous dataset. This is useful when data for the same variable is split across non-adjacent columns โ€” for example, sales data from two different sheets that you want to analyze together.

For more complex analyses involving pivot tables and aggregated data, standard deviation can also be used inside pivot table Value Field Settings. Right-click any value field in a pivot table and select Summarize Values By, then StdDev to show standard deviation by group directly in the pivot report. This is one of the most underused pivot table features for analysts who work with aggregated performance data. An overview of pivot table analysis options is in the Excel cheat sheet.

Running standard deviation calculations inside pivot tables opens additional options. When you add a field to the Values area of a pivot table, right-click it and select Value Field Settings. The Summarize Values By tab includes StdDev (STDEV.S equivalent) and StdDevp (STDEV.P equivalent). This calculates standard deviation at each grouping level in the pivot without writing any formulas in the underlying data range โ€” one of the more powerful analytical features frequently overlooked in pivot table training. For rank-based analysis, combining PERCENTILE, PERCENTRANK, and STDEV.S gives a multi-dimensional view of data distribution that a single metric cannot provide.

Take a Free Excel Practice Test

Statistical Analysis in Excel: 5-Step Process

1

Check for text stored as numbers, empty cells, and outliers that should be excluded from analysis (data entry errors, not genuine outliers). Use ISNUMBER() and TRIM() to identify and fix formatting issues before running any statistical functions.

2

Run AVERAGE, MEDIAN, STDEV.S, MIN, and MAX as a first pass. Compare the mean and median โ€” a large gap indicates skewed distribution. The standard deviation relative to the mean (coefficient of variation) tells you whether variability is high or low for this scale of data.

3

Calculate mean plus or minus 2 standard deviations. Values outside this range may be outliers. Investigate them โ€” some are data errors (fix them), some are genuine extreme values (keep them and note them). Removing outliers without investigation distorts analysis.

4

Create a histogram to see the shape of the distribution. Add standard deviation reference lines or error bars to charts. Use conditional formatting to highlight cells above or below threshold values based on the standard deviation formula.

5

Report mean, standard deviation, and sample size together โ€” these three numbers describe a dataset's central tendency and spread. Include the coefficient of variation when comparing across groups with different averages. For executive summaries, visualize rather than list numbers.

Excel vs. Dedicated Statistics Software for SD Analysis

Pros

  • No additional software โ€” everyone on the team has access to Excel
  • Easy to combine statistical results with data tables, charts, and reports in one file
  • STDEV functions update automatically when source data changes
  • Conditional formatting turns statistical thresholds into visual dashboards immediately
  • Pivot tables with StdDev aggregation handle grouped analysis without extra formulas

Cons

  • Excel is not designed for large-scale statistical analysis (R, Python, SPSS are more appropriate above ~100,000 rows)
  • No built-in distribution testing (normality tests, ANOVA) without add-ins
  • The Analysis ToolPak add-in is available but less powerful than dedicated stat software
  • Formula errors in large spreadsheets are hard to audit and can propagate silently
  • Version differences occasionally affect advanced statistical function behavior

Standard Deviation for Excel Exams and Certification

The Microsoft Office Specialist Excel exam does not test statistical theory, but it does test the ability to apply statistical functions correctly, use the right function variant for a given scenario, and identify which function to use based on a description. Understanding when to choose STDEV.S versus STDEV.P โ€” and being able to write both from memory โ€” covers what is typically tested.

Common exam-style tasks related to standard deviation include: writing a STDEV.S formula over a named range, applying conditional formatting to highlight cells that exceed the mean by a specified number of standard deviations, calculating a coefficient of variation using a cell reference to the standard deviation result, and combining STDEV.S with IF functions in array-style analysis. Practice with these specific task types builds the formula fluency that exam scoring rewards.

For candidates using this as part of broader Excel preparation, the Excel certification guide includes the full domain breakdown and a prioritized list of functions by exam weight. Standard deviation and other statistical functions fall within the Applying Formulas and Functions domain, which accounts for roughly 25% of the MOS Excel exam.

Beyond the MOS exam, standard deviation is tested in Excel interviews at analytical and financial roles. Interviewers typically ask candidates to: write a STDEV.S formula for a data range, explain the sample versus population distinction, describe how to highlight outliers using conditional formatting with a standard deviation threshold, and calculate a Z-score for a specific value. For one-time exploratory statistical analysis, the Excel Analysis ToolPak add-in (File, Options, Add-ins, Analysis ToolPak) includes a Descriptive Statistics tool that returns mean, SD, range, skewness, and kurtosis in one table โ€” faster than writing each formula individually for quick data profiling tasks.

The practical test of standard deviation proficiency is being able to explain a result in plain language after calculating it. Knowing the formula is the easy part; knowing what the number means for the specific dataset โ€” whether the variability is high or low for that context, and what decisions it informs โ€” is what distinguishes analysts who use Excel for reporting from those who use it for genuine insight generation.

Test Your Excel Knowledge Now

Excel Questions and Answers

What is the standard deviation formula in Excel?

The most commonly used formula is =STDEV.S(range), which calculates sample standard deviation. For example, =STDEV.S(B2:B100) returns the standard deviation of all values in cells B2 through B100. Use STDEV.P(range) instead if your data represents the complete population rather than a sample. The legacy STDEV function is identical to STDEV.S and still works in all Excel versions.

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

STDEV.S calculates sample standard deviation using n-1 in the denominator (Bessel's correction), which gives a slightly higher value. STDEV.P calculates population standard deviation using n in the denominator. Use STDEV.S when your data is a subset of a larger group (almost always). Use STDEV.P only when your data contains every single member of the population you want to describe, with no values missing.

How do I calculate standard deviation and mean together in Excel?

Calculate them in separate cells: =AVERAGE(B2:B100) for the mean and =STDEV.S(B2:B100) for the standard deviation. Reference these cells in other formulas โ€” for example, to calculate a Z-score for cell B2: =(B2-$E$1)/$F$1 where E1 holds the mean and F1 holds the standard deviation. Storing mean and SD in fixed cells makes building dashboards and conditional formatting rules much simpler.

How do I highlight outliers using standard deviation in Excel?

Use conditional formatting with a formula. Select the data range (e.g., B2:B100). Go to Home, Conditional Formatting, New Rule, Use a formula. Enter: =ABS(B2-AVERAGE($B$2:$B$100))>2*STDEV.S($B$2:$B$100). This highlights any value more than 2 standard deviations from the mean. The ABS function handles both high and low outliers in one rule. Choose a fill color and click OK.

How do I add standard deviation error bars to an Excel chart?

Click the chart to select it. Go to Chart Design in the ribbon, then Add Chart Element, then Error Bars, then More Error Bar Options. In the Format Error Bars panel, select Standard Deviation and set the multiplier (1 for ยฑ1 SD, 2 for ยฑ2 SD). Error bars visualize the variability around each data point and are standard in academic and scientific charts. They update automatically when the underlying data changes.

Why does my STDEV.S formula return a different result than expected?

The most common causes are: text values in the range (STDEV.S ignores them silently โ€” check with ISNUMBER()); a mix of STDEV.S and STDEV.P (they produce different results on small samples); or the range including the header row (which is text and ignored, but check that the range starts at the first data row). If the result looks wrong, verify the range in the formula bar and use =COUNTA(range)-COUNTIF(range,">0") patterns to check how many cells are actually being counted.
โ–ถ Start Quiz