How to Calculate a Confidence Interval in Excel (CONFIDENCE.T vs CONFIDENCE.NORM)
Excel's CONFIDENCE functions return only the margin of error, not the interval. You add that margin to the average and subtract it from the average to get the lower and upper bounds. For ordinary sample data, use CONFIDENCE.T. Use CONFIDENCE.NORM only when the standard deviation of the whole population is known from outside your sample.
Quick Answer: To calculate a 95% confidence interval in Excel, put the margin of error in one cell with =CONFIDENCE.T(0.05,STDEV.S(A2:A9),COUNT(A2:A9)). Then use =AVERAGE(A2:A9)-C2 for the lower bound and =AVERAGE(A2:A9)+C2 for the upper bound. For the eight scores used below, the margin is 4.23 and the interval runs from 80.52 to 88.98.
Build the Interval in Three Cells
You need the raw values in one column and three result cells. The example uses eight test scores, the same ones from our standard deviation guide, so the mean (84.75) and sample standard deviation (5.06) will look familiar.
- Enter the scores in A2:A9. Put a label in A1.
- Calculate the margin of error in C2. Type the formula below. The first argument, alpha, is 1 minus the confidence level, so 0.05 means 95%.
- Calculate the bounds in C3 and C4. Subtract the margin from the average for the lower bound and add it for the upper bound.
// C2: margin of error for a 95% interval
=CONFIDENCE.T(0.05,STDEV.S(A2:A9),COUNT(A2:A9))
// C3: lower bound
=AVERAGE(A2:A9)-C2
// C4: upper bound
=AVERAGE(A2:A9)+C2
| Cell | Holds | Result |
|---|---|---|
| Mean | =AVERAGE(A2:A9) | 84.75 |
| Sample standard deviation | =STDEV.S(A2:A9) | 5.06 |
| Standard error | =STDEV.S(A2:A9)/SQRT(COUNT(A2:A9)) | 1.79 |
| C2, margin of error | =CONFIDENCE.T(0.05,STDEV.S(A2:A9),COUNT(A2:A9)) | 4.23 |
| C3, lower bound | =AVERAGE(A2:A9)-C2 | 80.52 |
| C4, upper bound | =AVERAGE(A2:A9)+C2 | 88.98 |
The standard error is the sample standard deviation divided by the square root of the count. The margin of error is that standard error multiplied by a critical value from the t distribution. Our standard error guide explains the first half of that chain.
One detail trips people up. Microsoft's page for the function describes standard_dev as the known population standard deviation. With sample data you pass STDEV.S anyway, and CONFIDENCE.T supplies the extra width for having estimated the spread from a small sample. Microsoft's own example confirms the arithmetic: alpha 0.05, standard deviation 1 and size 50 returns 0.284196855, which equals the t value for 49 degrees of freedom divided by the square root of 50.
CONFIDENCE.T or CONFIDENCE.NORM: Which One Fits Your Data
Use CONFIDENCE.T when the standard deviation came from your sample, which is almost always. Use CONFIDENCE.NORM when the standard deviation of the entire population is known in advance, for example from a long-running process with a documented spread. Both functions take the same three arguments: alpha, standard deviation and sample size.
The difference is the critical value. The normal curve uses 1.96 for 95% at any sample size. The t distribution uses a larger number for small samples, because a small sample gives a shaky estimate of the spread, and the number shrinks toward 1.96 as the sample grows.
| Sample size | Degrees of freedom | t critical value (95%) | Normal critical value (95%) |
|---|---|---|---|
| 8 | 7 | 2.365 | 1.960 |
| 30 | 29 | 2.045 | 1.960 |
| 100 | 99 | 1.984 | 1.960 |
On the eight scores, CONFIDENCE.NORM gives a margin of 3.51 and an interval of 81.24 to 88.26. CONFIDENCE.T gives 4.23 and 80.52 to 88.98. The normal version looks tighter, but that precision is borrowed: it ignores the uncertainty in a standard deviation estimated from only eight values.
The legacy CONFIDENCE function still exists for older files. Microsoft documents it with the same normal-curve formula as CONFIDENCE.NORM, so treat it as the same thing and prefer the newer name. Function behavior in this guide follows Microsoft's documentation for CONFIDENCE.T, CONFIDENCE.NORM and CONFIDENCE.
The Long Formula, and How to Get a One-Sided Bound
You can skip the CONFIDENCE functions entirely and write the interval from its parts. This version shows every ingredient, which helps when you need to explain the number to someone else.
// Lower bound, 95% interval
=AVERAGE(A2:A9)-T.INV.2T(0.05,COUNT(A2:A9)-1)*STDEV.S(A2:A9)/SQRT(COUNT(A2:A9))
// Upper bound, 95% interval
=AVERAGE(A2:A9)+T.INV.2T(0.05,COUNT(A2:A9)-1)*STDEV.S(A2:A9)/SQRT(COUNT(A2:A9))
T.INV.2T returns the two-tailed t value for a given alpha and degrees of freedom. Here that is 2.3646, and multiplying it by the 1.79 standard error gives the same 4.23 margin as CONFIDENCE.T.
Sometimes you only care about one direction, such as "the average is at least this high." A one-sided 95% bound puts all 5% of the error in one tail, so it uses the critical value of a two-sided 90% interval. Swap 0.05 for 0.10 in T.INV.2T and use only the bound you need. For the example, the one-sided 95% lower bound is 81.36.
Check Your Own Numbers
Paste a list of values, pick a confidence level and compare the output with your spreadsheet. The math runs in your browser and nothing is uploaded.
Your Excel formula will appear here. A single value gives #DIV/0!, exactly as CONFIDENCE.T does. Press Ctrl+Enter (Cmd+Enter on Mac) to calculate.
Want more free calculators and formula guides?
90%, 95% and 99% Compared on the Same Data
A higher confidence level gives a wider interval. You are asking for a range that captures the true average more reliably, and the only way to do that is to make the range bigger. Here is the same set of eight scores at three levels.
| Confidence level | Alpha | t critical value | Margin of error | Interval |
|---|---|---|---|---|
| 90% | 0.10 | 1.895 | 3.39 | 81.36 to 88.14 |
| 95% | 0.05 | 2.365 | 4.23 | 80.52 to 88.98 |
| 99% | 0.01 | 3.499 | 6.27 | 78.48 to 91.02 |
Moving from 95% to 99% widens the margin by about half. With only eight observations, that is a steep price. If the width is a problem, collecting more data helps far more than lowering the confidence level.
Confidence Intervals for a Percentage
For a survey result such as "30% said yes," Excel has no dedicated function, but the formula is short. The margin of error is the normal critical value times the square root of p(1−p)/n, where p is the share and n is the number of respondents.
Suppose 120 of 400 respondents answered yes. Put 0.3 in C2 and 400 in C3.
// D2: margin of error for a 95% interval on a proportion
=NORM.S.INV(1-0.05/2)*SQRT(C2*(1-C2)/C3)
// D3: lower bound
=C2-D2
// D4: upper bound
=C2+D2
The margin is 0.0449, so the interval runs from 25.5% to 34.5%, a range of about 4.5 percentage points either side. This is the normal-approximation method. A common rule of thumb is that it works when both the yes count and the no count are at least 10, which holds here at 120 and 280. For very small counts, or shares close to 0% or 100%, use a method built for them. To turn raw counts into shares first, see our percentage calculator.
How Many Observations You Need for a Target Margin
You can work backward from the margin you can live with. The number of observations needed is roughly (critical value × standard deviation ÷ margin)², rounded up. If you want the average of these scores pinned down to within ±2 points at 95%, and you expect a standard deviation near 5.06:
=ROUNDUP((NORM.S.INV(0.975)*5.06/2)^2,0)
The result is 25. Treat that as a floor, because using the normal value slightly understates what the t distribution needs at small sizes, and the standard deviation you plug in is itself an estimate. A pilot sample gives you a better figure to use.
How to Read the Result
A 95% confidence interval says the method used to build it captures the true average in about 95% of repeated samples. Penn State's introductory statistics course frames it as 95% confidence that the population parameter lies in the range, and warns against treating any single interval as certain to contain the true value (Penn State STAT 200, Interpreting Confidence Intervals).
The most common misreading is treating the interval as the range where 95% of the data sits. It is not. In the example, the interval for the mean is 80.52 to 88.98, yet only four of the eight scores land inside it, which is 50%. The interval describes where the average probably lies. The spread of the scores themselves is what the standard deviation describes.
Two practical readings are useful. If an interval for a difference or a change excludes zero, the data is consistent with a real difference at that confidence level. If two intervals for separate groups barely overlap, be cautious about concluding anything from the overlap alone, and run a proper test such as the one in our p-value guide.
Why Excel Returns an Error or a Wrong Answer
| What you see | Likely cause | Fix |
|---|---|---|
#NUM! | Alpha is 0 or less, or 1 or more, for example 95 typed instead of 0.05. The standard deviation is 0 or negative. | Use alpha as a decimal below 1. Check the standard deviation cell is a positive number. |
#DIV/0! from CONFIDENCE.T | The sample size is 1. | You need at least two values to estimate a spread. |
#VALUE! | An argument is text, so Excel cannot read it as a number. | Point each argument at a numeric cell or a function such as COUNT. |
| A believable but far too narrow interval | Alpha entered as 0.95, which asks for a 5% confidence interval, or CONFIDENCE.NORM used on a small sample. | Alpha is 1 minus the confidence level. Use CONFIDENCE.T for samples. |
| An interval that looks like just a number | The margin of error was used on its own. | Add it to the mean and subtract it from the mean. |
| Different from a colleague's result | One of you used STDEV.P, or COUNTA instead of COUNT, so text cells inflated the size. | Use STDEV.S and COUNT, as in the formulas above. |
The spread feeding the interval matters as much as the function. If you are unsure which standard deviation function to use, the STDEV.S versus STDEV.P comparison sets out the difference. For a chart-ready version of the same idea, the SEM guide shows how to add error bars.
Frequently Asked Questions
Can Excel give a confidence interval for the difference between two groups?
Not with a single worksheet function. You calculate the difference between the two averages, then add and subtract a t value multiplied by the standard error of that difference. If you only need to know whether two groups differ, a test returns a p-value directly.
Does a wide confidence interval mean my data is bad?
No. Width comes from the spread in the data, the number of observations and the confidence level you chose. A wide interval from a small sample is an honest sign that the sample cannot pin the average down yet. More observations narrow it, roughly in proportion to the square root of the sample size.
Does my data have to be normally distributed?
The t-based interval assumes the sample average behaves approximately normally. For roughly bell-shaped data that holds even with small samples, and larger samples relax the requirement. With a small sample that is heavily skewed or contains outliers, treat the interval cautiously.
Why does an online calculator show a different interval than Excel?
Usually it used the normal critical value where CONFIDENCE.T used the t value, or the two used different standard deviations. For eight values the critical values are 2.365 and 1.960, which is enough to change the margin by about a sixth.
Related Excel Statistics Guides From Anchor AI Tools
Accuracy Note: This guide explains standard statistical formulas for planning and educational purposes. For research, clinical or regulated reporting, confirm your method and results with a qualified statistician.