To calculate a 95% confidence interval for a mean in Excel: find the sample mean with AVERAGE, calculate the margin of error with CONFIDENCE.T(0.05,STDEV.S(range),COUNT(range)), then subtract and add that margin to the mean. This method uses a t distribution when the population standard deviation is unknown.
This worked example uses fictional study-session durations created for teaching. It estimates one population mean, not a proportion, an individual student’s duration, or a difference between two groups. The calculations were independently checked in Python; the formulas below are provided for reproduction in Excel.
Suppose a researcher wants to estimate the average duration of a study session in a defined student population. For this exercise, assume an independent random sample of 12 students, with one session duration per student. The population standard deviation is unknown, so use a one-sample t interval with 11 degrees of freedom.
For such a small sample, the population should be approximately normal without severe skew or extreme outliers. Inspect the data and consider how the sample was collected before calculating. A formula cannot fix a biased convenience sample, dependent observations, or an unsuitable model. These fictional values do not establish anything about actual college students.
Copy the following column into cell A1 of a blank worksheet. The header belongs in A1 and the 12 numbers in A2:A13. Values are minutes.
Session_minutes
42
47
51
46
53
49
44
56
48
50
45
57
Put the labels in column C and formulas in column D. Keep the full precision in the cells and format the displayed results to four decimal places. The formulas use English Excel function names and commas; some regional settings require semicolons.
| Cells (label / formula) | Quantity | Excel formula | Expected result |
|---|---|---|---|
| C2 / D2 | Sample size | =COUNT(A2:A13) | 12.0000 |
| C3 / D3 | Sample mean | =AVERAGE(A2:A13) | 49.0000 |
| C4 / D4 | Sample standard deviation | =STDEV.S(A2:A13) | 4.6515 |
| C5 / D5 | Standard error | =D4/SQRT(D2) | 1.3428 |
| C6 / D6 | Critical t value | =T.INV.2T(0.05,D2-1) | 2.2010 |
| C7 / D7 | Margin of error | =D6*D5 | 2.9554 |
| C8 / D8 | Lower confidence limit | =D3-D7 | 46.0446 |
| C9 / D9 | Upper confidence limit | =D3+D7 | 51.9554 |
Enter this in a spare cell. It should match D7, not the lower or upper limit:
=CONFIDENCE.T(0.05,STDEV.S(A2:A13),COUNT(A2:A13))
The result is approximately 2.9554 minutes. The first argument is alpha: 0.05 for 95% confidence. Use 0.10 for 90% confidence or 0.01 for 99% confidence. The standard deviation here is the sample estimate from STDEV.S.
The formula is sample mean ± t critical value × sample standard deviation / √sample size. The standard error measures the sampling variability of the mean; it is not the same as the variability of individual observations.
49.0000 ± 2.2010 × (4.6515 / √12)
= 49.0000 ± 2.9554
= (46.0446, 51.9554) minutes
Example results paragraph: In this fictional sample of 12 independent study sessions, the mean duration was 49.00 minutes (sample SD = 4.65). A one-sample t interval gave a 95% confidence interval of 46.04 to 51.96 minutes for the population mean duration, assuming the sampling and distribution conditions hold.
The 95% refers to the long-run coverage of the method: across repeated samples collected in the same way, about 95% of the resulting intervals would contain the fixed population mean. It does not mean that 95% of individual sessions lie inside this interval.
Reporting one number as the interval: CONFIDENCE.T supplies the margin. Report both endpoints after adding and subtracting it from the mean.
Using 95 or 0.95 as alpha: for a 95% interval, enter 0.05. Using STDEV.P: these observations are a sample; use STDEV.S. Counting the header: use COUNT on the numeric range, not COUNTA on a range containing text.
Numbers stored as text: verify that COUNT returns 12 before continuing. Convert text-formatted numbers deliberately; do not silently remove missing observations or replace them with zero. Rounding too soon: keep formulas at full precision until reporting the final results.
A population proportion needs a proportion interval. Paired measurements need an interval for the within-person differences. Two independent groups need an interval for the difference between means. A z interval for a mean requires a justified known population standard deviation; a sample of 30 does not automatically make that standard deviation known.
For the same sample, a higher confidence level makes the interval wider. More independent observations usually improve precision, but cannot eliminate sampling bias. You can explore mean intervals with the confidence interval calculator.
Share the question, your attempted formula, the cell range, and the step you cannot explain. Remove names and other personal information before sharing a dataset. Excel statistics homework guidance can help you check the method and interpretation. For a guided walkthrough, see live statistics tutoring, starting at $35/hour; availability and scope are confirmed before booking.
Microsoft: CONFIDENCE.T syntax; Penn State: confidence intervals for means. The dataset and teaching scenario on this page are original fictional examples.
Share your question, what you have tried, and your deadline. We’ll confirm the scope, availability, and price before work begins.
Request Statistics Guidance →