How to Calculate Standard Error in Excel (with Examples) – LicenceHouse guide

Excel has no STDERR function for the standard error of the mean, so you combine two functions: =STDEV.S(B2:B11)/SQRT(COUNT(B2:B11)). This divides the sample standard deviation by the square root of the sample size. For ten values with a standard deviation of 2.17, the standard error is about 0.69.

What you need Formula (data in B2:B11) Result for the sample data
Mean =AVERAGE(B2:B11) 14.5
Sample standard deviation =STDEV.S(B2:B11) 2.173
Sample size =COUNT(B2:B11) 10
Standard error of the mean =STDEV.S(B2:B11)/SQRT(COUNT(B2:B11)) 0.687
95% confidence margin =CONFIDENCE.T(0.05,STDEV.S(B2:B11),COUNT(B2:B11)) 1.555
Geometric mean =GEOMEAN(B2:B11) Positive values only

What is the standard error in Excel?

The standard error of the mean (SEM) measures how precisely your sample mean estimates the true population mean. A small standard error means the average would barely move if you repeated the sample; a large one means it could shift a lot.

It's different from the standard deviation. Standard deviation describes how spread out the individual values are. Standard error describes how uncertain the average is. Standard error shrinks as the sample grows, because it divides by the square root of n:

SE = s / √n

Here s is the sample standard deviation and n is the number of values. Quadrupling the sample size halves the standard error.

How do I calculate standard error in Excel?

Use STDEV.S for the standard deviation, COUNT for the sample size and SQRT for the square root, all in one formula. We'll use these ten test scores in B2:B11:

Standard error formula =STDEV.S(B2:B11)/SQRT(COUNT(B2:B11)) explained: standard deviation 2.173 divided by the square root of 10 gives 0.687.

Cell B2 B3 B4 B5 B6 B7 B8 B9 B10 B11
Score 12 15 11 14 18 13 16 15 17 14
  1. Click an empty cell, such as D2.
  2. Type =STDEV.S(B2:B11)/SQRT(COUNT(B2:B11)) and press Enter.
  3. Excel returns 0.687184. Use Home > Decrease Decimal to show 0.687.

To make the working easier to check, split it across cells: D2 =STDEV.S(B2:B11) (2.173), D3 =COUNT(B2:B11) (10), D4 =D2/SQRT(D3) (0.687).

Use COUNT rather than ROWS or typing 10. COUNT counts only cells holding numbers, so blanks and text labels don't inflate n. STDEV.S also skips empty cells, text and logical values in a range, which keeps the two halves of the formula consistent. Microsoft's STDEV.S function reference confirms it uses the n-1 sample method and ignores text and empty cells in references. For more on how COUNT differs from COUNTA, see our COUNT and COUNTA guide.

Should I use STDEV.S or STDEV.P for standard error?

Use STDEV.S. The standard error of the mean assumes your data is a sample from a larger population, and STDEV.S applies the n-1 correction for samples. STDEV.P assumes you have the entire population, in which case there's nothing to estimate and the standard error isn't meaningful in the usual sense.

Comparison of STDEV.S and STDEV.P for standard error: STDEV.S gives 2.173 and 0.687, while STDEV.P gives 2.062 and understates it as 0.652.

With the sample data, STDEV.P returns 2.062, which would understate the standard error as 0.652. The older STDEV function behaves the same as STDEV.S and still works, but STDEV.S is the clearer name in current versions.

What we commonly see: people use =STDEV.S(B2:B11)/SQRT(10) with a typed sample size, then add rows later. The formula keeps dividing by 10 and the standard error is wrong. Always calculate n with COUNT, or convert the data to a table so ranges grow automatically.

Can the Analysis ToolPak calculate standard error?

Yes. The Descriptive Statistics tool in the Analysis ToolPak reports the standard error alongside the mean, median, standard deviation and more.

Steps to get the standard error from the Analysis ToolPak: load the add-in, run Descriptive Statistics on B1:B11 and read Standard Error, 0.687.

  1. Load the add-in once: File > Options > Add-ins, choose Excel Add-ins in the Manage box, click Go, tick Analysis ToolPak and click OK.
  2. Go to Data > Data Analysis.
  3. Choose Descriptive Statistics and click OK.
  4. Set Input Range to B1:B11 and tick Labels in first row if B1 holds a heading.
  5. Tick Summary statistics, and Confidence Level for Mean if you want the 95% margin too.
  6. Choose an output location and click OK.

The "Standard Error" row matches the formula result, 0.687. Microsoft's guide to loading the Analysis ToolPak covers the installation step. The ToolPak output is static, so it won't update if your data changes; rerun the tool or use formulas for live results. The same add-in runs regression, as shown in our guide to regression analysis in Excel.

How do I use standard error for confidence intervals and error bars?

Multiply the standard error by a critical value to get a confidence interval around the mean. For small samples, CONFIDENCE.T does this in one step, using the t-distribution:

=CONFIDENCE.T(0.05,STDEV.S(B2:B11),COUNT(B2:B11))

It returns 1.555 for the sample data. The 95% confidence interval is the mean plus or minus this margin: 14.5 ± 1.555, or roughly 12.95 to 16.05. The first argument, 0.05, is alpha, so 0.05 gives a 95% interval and 0.01 gives 99%.

For charts, the standard error is the usual size for error bars on a column or line chart of means. Calculate the standard error for each group, then use Chart Design > Add Chart Element > Error Bars > More Error Bars Options, choose Custom and point both the positive and negative values at your standard error cells. Our guide to adding error bars in Excel walks through the dialog. Excel's built-in Standard Error option calculates from the plotted series, which is rarely what you want when each bar is already an average.

Advanced nuance: when you compare group means, don't average the group standard errors to get an overall one. Recalculate from the combined raw data, for the same reason an average of averages misleads; our guide to average of averages in Excel explains the weighting problem.

How do I calculate the geometric mean in Excel?

Use GEOMEAN: =GEOMEAN(B2:B11). The geometric mean multiplies the values together and takes the nth root, which makes it the right average for growth rates, ratios and anything that compounds.

All values must be positive. If any value is zero or negative, GEOMEAN returns #NUM!, as Microsoft's GEOMEAN function reference explains. That's a problem for percentage returns, which can be negative. The fix is to convert each return to a growth factor first:

Year Return (C) Growth factor
1 10% 1.10
2 -5% 0.95
3 20% 1.20
4 8% 1.08
=GEOMEAN(1+C2:C5)-1

This returns 7.88%, the average annual compound growth. The simple average, =AVERAGE(C2:C5), gives 8.25%, which overstates the real growth. In Excel 2021, 2024 and Microsoft 365 the formula works as typed. In Excel 2019 and earlier, it's an array formula, so press Ctrl+Shift+Enter instead of Enter.

STDEV.S, SQRT, COUNT, GEOMEAN and CONFIDENCE.T are available in every current version from Excel 2016 to Microsoft 365, on Windows and Mac. The dynamic array behaviour that removes the need for Ctrl+Shift+Enter starts with Excel 2021; the Office 2024 collection includes Excel 2024, which has it.

Frequently asked questions

Is there a STDERR or SEM function in Excel?

No. Excel has STEYX, which returns the standard error of a regression prediction, but no function for the standard error of the mean. Use =STDEV.S(range)/SQRT(COUNT(range)) instead, or run Descriptive Statistics from the Analysis ToolPak, which reports the same value in its Standard Error row.

What is the difference between standard deviation and standard error?

Standard deviation measures how spread out the individual data points are around the mean. Standard error measures how precisely the sample mean estimates the population mean. Standard error equals the standard deviation divided by the square root of the sample size, so it is always smaller and shrinks as you collect more data.

How do I calculate standard error of a proportion in Excel?

Use =SQRT(p*(1-p)/n), where p is the proportion and n is the sample size. If 45 of 120 people answered yes, p is =45/120 (0.375), and the standard error is =SQRT(0.375*(1-0.375)/120), about 0.044. This formula suits reasonably large samples.

Why does GEOMEAN return #NUM!?

GEOMEAN only accepts values greater than zero. A zero, a negative number or a negative percentage return in the range produces #NUM!. For returns, convert each to a growth factor by adding 1, use =GEOMEAN(1+range)-1, and make sure no single period lost 100% or more.

Related guides

Links in this guide

Link Type Why it helps
Microsoft Support: STDEV.S function External Confirms the n-1 sample method
Microsoft Support: Load the Analysis ToolPak External Installs Descriptive Statistics
Microsoft Support: GEOMEAN function External Syntax and the #NUM! rule
COUNT and COUNTA in Excel Internal Getting the sample size right
Regression analysis in Excel Internal Another Analysis ToolPak tool
Add error bars in Excel Internal Plot standard error on a chart
Average of averages in Excel Internal Why combined statistics need raw data
Office 2024 collection Internal Excel with dynamic arrays for GEOMEAN(1+range)
Data analysis, Excel, Excel formulas, How-to