ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Math
  3. How to Calculate a Confidence Interval in Excel

How to Calculate a Confidence Interval in Excel

By ExcelReady Team·Updated November 3, 2026·6 min read

The short answer

To calculate a 95% confidence interval for a mean in Excel, find the margin of error with =CONFIDENCE.T(0.05,STDEV.S(range),COUNT(range)). Then subtract it from the average for the lower limit and add it for the upper limit. For eight delivery times with a mean of 32 minutes and a standard deviation of 4, the interval is 28.66 to 35.34 minutes.

Key takeaways

  • A confidence interval is the sample mean plus or minus a margin of error.
  • =CONFIDENCE.T(alpha, standard_dev, size) returns the margin of error. Alpha is 1 minus the confidence level, so 0.05 for 95%.
  • Use CONFIDENCE.T for sample data. CONFIDENCE.NORM assumes you know the population standard deviation and gives a narrower interval.
  • A higher confidence level or a smaller sample gives a wider interval.
On this page+
  1. What a confidence interval tells you
  2. The confidence interval formula in Excel
  3. Step by step: a 95% confidence interval for a mean
  4. CONFIDENCE.T vs CONFIDENCE.NORM
  5. Change the confidence level to 90% or 99%
  6. Confidence interval for a proportion
  7. Common confidence interval mistakes
  8. Practise it

A confidence interval in Excel takes three numbers from your data (the average, the standard deviation and the count) and one function, CONFIDENCE.T, which returns the margin of error. The interval is the average minus that margin to the average plus it. This guide is for students, analysts and anyone reporting survey or test results who needs to say how precise an average is.

What a confidence interval tells you#

A confidence interval is a range around a sample average that likely contains the true average of the whole group. You measure a sample (some of the orders, some of the customers) because you can't measure everything. The interval shows how far off the sample average might be.

It has two parts:

  • The point estimate: the sample mean, from AVERAGE.
  • The margin of error: how far to go either side, which depends on the spread of the data, the sample size and the confidence level.

A 95% confidence level describes the method. If you took many samples and built an interval from each one, about 95% of those intervals would contain the true mean. It does not mean that 95% of the individual values fall inside the range.

The confidence interval formula in Excel#

The margin of error is the critical value times the standard error. The standard error is the standard deviation divided by the square root of the count:

Excel formula
margin = t × STDEV.S(range) / SQRT(COUNT(range))

CONFIDENCE.T does all of this in one step:

Excel formula
=CONFIDENCE.T(alpha, standard_dev, size)
ArgumentWhat it meansExample
alpha1 minus the confidence level0.05 for 95%
standard_devThe sample standard deviationSTDEV.S(B2:B9)
sizeHow many values are in the sampleCOUNT(B2:B9)

CONFIDENCE.T works in Excel 2010 and later, including Microsoft 365 and Excel for Mac. If you need a refresher on spread, read how to calculate standard deviation in Excel.

Step by step: a 95% confidence interval for a mean#

Here are eight delivery times in minutes, in B2:B9:

AB
1OrderMinutes
2Order 130
3Order 225
4Order 338
5Order 433
6Order 533
7Order 636
8Order 731
9Order 830

Build the interval in column E, one step per cell:

CellLabelFormulaResult
E2Mean=AVERAGE(B2:B9)32
E3Standard deviation=STDEV.S(B2:B9)4
E4Count=COUNT(B2:B9)8
E5Margin of error=CONFIDENCE.T(0.05,E3,E4)3.344
E6Lower limit=E2-E528.66
E7Upper limit=E2+E535.34

So you can report: "Average delivery time was 32 minutes (95% CI: 28.66 to 35.34)." AVERAGE ignores empty cells and text, and COUNT counts only numbers, so a blank row won't distort either one. The AVERAGE function guide and the COUNT function guide cover those details, and COUNT, COUNTA and COUNTBLANK compared explains why COUNT is the right count here.

To check the margin by hand, use the t critical value from T.INV.2T:

Excel formula
=T.INV.2T(0.05,E4-1)*E3/SQRT(E4)

T.INV.2T(0.05,7) is about 2.365, and 2.365 × 4 ÷ √8 gives the same 3.344. The E4-1 is the degrees of freedom: the count minus one.

CONFIDENCE.T vs CONFIDENCE.NORM#

Use CONFIDENCE.T when the standard deviation comes from your sample, which is almost always. CONFIDENCE.NORM uses the normal distribution's critical value of 1.96 and assumes you already know the population standard deviation.

FunctionCritical value (95%)Margin on the exampleInterval
=CONFIDENCE.T(0.05,4,8)about 2.3653.34428.66 to 35.34
=CONFIDENCE.NORM(0.05,4,8)about 1.9602.77229.23 to 34.77

With eight values, the difference is large. With hundreds of values, the two functions give almost the same answer. The older CONFIDENCE function still works and matches CONFIDENCE.NORM. Which standard deviation to feed in matters too: STDEV.S vs STDEV.P explains why a sample needs STDEV.S.

Change the confidence level to 90% or 99%#

Change alpha to change the level. Higher confidence needs a wider interval:

Confidence levelAlphaMargin (CONFIDENCE.T)Interval
90%0.102.6829.32 to 34.68
95%0.053.3428.66 to 35.34
99%0.014.9527.05 to 36.95

Put the level in a cell, for example 95% in H1, and use =CONFIDENCE.T(1-H1,E3,E4). Then the whole sheet updates when you change one number. To halve the margin of error, you need roughly four times as many values, because the count sits under a square root.

Confidence interval for a proportion#

For yes/no data, such as "62% of 200 people said yes", the margin uses the proportion instead of a standard deviation:

Excel formula
=NORM.S.INV(0.975)*SQRT(p*(1-p)/n)

With p = 0.62 in B1 and n = 200 in B2, =NORM.S.INV(0.975)*SQRT(B1*(1-B1)/B2) returns about 0.067. The interval is 55.3% to 68.7%. NORM.S.INV(0.975) is the 1.96 critical value. This simple method works best when the sample is large and the proportion is not close to 0% or 100%. The guide to analysing survey results in Excel shows how to get p from raw responses with COUNTIF.

Common confidence interval mistakes#

These are the errors that give a wrong interval without any warning:

  1. Using alpha = 0.95. Alpha is 1 minus the level, so 95% means 0.05. With 0.95, the margin is tiny.
  2. Using STDEV.P on a sample. It divides by n instead of n − 1 and understates the spread.
  3. Counting with COUNTA. If the range has a header or notes, COUNTA counts them as values. Use COUNT.
  4. Reading the interval as the range of the data. The interval is about the mean, not about single values.
  5. Skipping the ToolPak check. If you have the Analysis ToolPak, Data > Data Analysis > Descriptive Statistics with Confidence Level for Mean ticked reports the margin of error (3.344 here). On Windows, turn it on in File > Options > Add-ins; on a Mac, use Tools > Excel Add-ins.

Practise it#

A confidence interval rests on two basics: the average and the count. Practise AVERAGE, MIN and MAX in a live spreadsheet, then practise COUNT, COUNTA and COUNTBLANK so you always count the right cells. You type each formula and it is checked instantly. For a refresher on summary numbers, see AVERAGE, MIN and MAX explained, or try the lower-limit exercise on this page.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Find the lower limit of the 95% confidence interval. E2 holds the standard deviation and E3 the t critical value. Click E5 and type =AVERAGE(B2:B9)-E3*E2/SQRT(COUNT(B2:B9)).

fx
ABCDEF
1
Order
Minutes
2
Order 1
30
Std dev
4
3
Order 2
25
t value
2.365
4
Order 3
38
5
Order 4
33
Lower limit
6
Order 5
33
7
Order 6
36
8
Order 7
31
9
Order 8
30
10
11
12

Tip: The mean is 32. The margin is 2.365 × 4 ÷ √8, about 3.34, so the lower limit is about 28.66.

Practise this in a lesson

LessonAVERAGE, MIN and MAXSummarize a list with its average, smallest and largest values.LessonCOUNT, COUNTA and COUNTBLANKCount numbers, filled cells and empty cells, a quick way to audit data.Function guideAVERAGECalculate the mean in Excel with AVERAGE. See how it treats blanks and zeros, avoid common errors, and practice in a live sheet.Function guideCOUNTCount cells that hold numbers or dates with Excel's COUNT. See what it skips, how it differs from COUNTA, then try a live exercise.

Frequently asked questions

How do you calculate a 95% confidence interval in Excel?

+

Work out the margin with =CONFIDENCE.T(0.05,STDEV.S(B2:B9),COUNT(B2:B9)). Then the lower limit is =AVERAGE(B2:B9) minus the margin and the upper limit is the average plus the margin.

What is the difference between CONFIDENCE.T and CONFIDENCE.NORM?

+

CONFIDENCE.T uses the t-distribution, which is right when the standard deviation comes from your sample. CONFIDENCE.NORM uses the normal distribution and assumes the population standard deviation is known, so it gives a slightly smaller margin.

What does a 95% confidence interval mean?

+

It means the method works 95% of the time: if you took many samples and built an interval from each, about 95% of those intervals would contain the true mean. It does not mean 95% of the data falls inside the interval.

How do I get a confidence interval from the Analysis ToolPak?

+

Run Data > Data Analysis > Descriptive Statistics and tick Confidence Level for Mean. The value it reports is the margin of error, the same number CONFIDENCE.T returns.

Why is my confidence interval so wide?

+

Wide intervals come from a small sample, a large standard deviation or a high confidence level. Collecting more data is the most reliable way to narrow it.

Sources

  • AVERAGE function - Microsoft Support
  • COUNT function - Microsoft Support
  • SQRT function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What a confidence interval tells you
  2. The confidence interval formula in Excel
  3. Step by step: a 95% confidence interval for a mean
  4. CONFIDENCE.T vs CONFIDENCE.NORM
  5. Change the confidence level to 90% or 99%
  6. Confidence interval for a proportion
  7. Common confidence interval mistakes
  8. Practise it

Keep reading

Math· 7 min read

How to Calculate Standard Deviation in Excel

To calculate standard deviation in Excel, use =STDEV.S(B2:B7) when your data is a sample, or =STDEV.P(B2:B7) when it covers the whole group you care about. Standard deviation measures how far values typically sit from the average. A small result means the values are close together; a large one means they are spread out.

Comparisons· 7 min read

STDEV.S vs STDEV.P: Sample or Population?

Use STDEV.S when your numbers are a sample taken from a bigger group, such as six weeks out of a year. Use STDEV.P when your numbers are the whole group you care about, such as every person on one team. STDEV.S divides by n minus 1, so it always gives a slightly larger result. When in doubt, use STDEV.S.

Math· 5 min read

AVERAGE, MIN and MAX in Excel With Examples

AVERAGE returns the mean of a range, MIN returns the smallest number and MAX returns the largest. All three take the same input: =AVERAGE(B2:B6), =MIN(B2:B6) and =MAX(B2:B6). They skip empty cells and text but count zeros, and =MAX(B2:B6)-MIN(B2:B6) shows how spread out the values are.

More on math

  • How to Convert Units in Excel With the CONVERT Function
  • Find the Correlation Between Two Columns in Excel
  • How to Calculate Cost per Unit in Excel
  • COUNT, COUNTA and COUNTBLANK: Counting Cells in Excel
  • How to Calculate Cumulative Percentage in Excel
  • How to Calculate Customer Lifetime Value (CLV) in Excel
All math articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free