How to Plot Confidence Intervals in Excel (With Examples)


A confidence interval represents a range of values that is likely to contain some population parameter with a certain level of confidence.

This tutorial explains how to plot confidence intervals on bar charts in Excel.

Example: Plot Confidence Intervals on Bar Graph in Excel

Suppose we have the following data in Excel that shows the mean of four different categories along with the corresponding margin of error for the 95% confidence intervals:

To create a bar chart to visualize the category means, highlight cells in the range A1:B5 and then click the Insert tab along the top ribbon. Then click Insert Column or Bar Chart within the Charts group.

This will produce the following bar chart:

To add confidence interval bands, click the plus sign (+) in the top right corner of the bar chart, then click Error Bars, then More Options:

In the window that appears to the right, click the Custom button at the bottom. In the new window that appears, choose =Sheet1!$C$2:$C$5 for both the positive error value and negative error value. Then click OK.

This will produce the following confidence interval bands in the bar chart:

Feel free to change the color of the bars as well to make the confidence interval bands easier to see:

plot confidence interval in Excel

The top of the bar represents the mean value for each category and the error bars show the range of the confidence interval for each mean.

For example:

  • The mean value for category A is 12 and the 95% confidence interval for this mean ranges from 10 to 14.
  • The mean value for category B is 15 and the 95% confidence interval for this mean ranges from 12 to 18.
  • The mean value for category C is 18 and the 95% confidence interval for this mean ranges from 13 to 23.
  • The mean value for category D is 13 and the 95% confidence interval for this mean ranges from 10 to 16.

Additional Resources

The following tutorials provide additional information about confidence intervals:

An Introduction to Confidence Intervals
How to Calculate Confidence Intervals in Excel
Margin of Error vs. Confidence Interval: What’s the Difference?

2 Replies to “How to Plot Confidence Intervals in Excel (With Examples)”

  1. Hi Zach. I like your write-up. It is very simple. I have a data set that contains 5 categories and for each category, I have the mean value, and then a lower limit CI and an upper limit CI. These are 95% confidence intervals. These data were exported from R. The lower CI and Upper CI have specific values that I would like to input into an Excel Table, rather than using the margin as you describe in your post to create a CI bar. Do you have any advice? thanks.

    Weighted Percentage LowerCI Upper CI
    Category A 60 51 69
    Category B 18 9 28
    Category C 17 11 24
    Category D 14 8 20
    Category E 7 2 12

    1. Hi Billy…To represent your data with the given confidence intervals (CI) in Excel, here’s a step-by-step guide on how to create a table and visualize the data with error bars for the CIs:

      ### Steps to Input Data and Create Error Bars in Excel:

      #### 1. **Create the Table:**
      – In an Excel worksheet, create columns for your **Categories**, **Mean** (Weighted Percentage), **Lower CI**, and **Upper CI**.

      Example:
      “`
      | Category | Mean | Lower CI | Upper CI |
      |————|——|———-|———-|
      | Category A | 60 | 51 | 69 |
      | Category B | 18 | 9 | 28 |
      | Category C | 17 | 11 | 24 |
      | Category D | 14 | 8 | 20 |
      | Category E | 7 | 2 | 12 |
      “`

      #### 2. **Calculate the Error Bars:**
      – The error bars for Excel need to represent the distance between the **mean** and the **upper/lower CIs**.
      – Create two additional columns: **Lower Error** and **Upper Error**. These are calculated as:
      – **Lower Error** = Mean – Lower CI
      – **Upper Error** = Upper CI – Mean

      Example:
      “`
      | Category | Mean | Lower CI | Upper CI | Lower Error | Upper Error |
      |————|——|———-|———-|————-|————-|
      | Category A | 60 | 51 | 69 | 9 | 9 |
      | Category B | 18 | 9 | 28 | 9 | 10 |
      | Category C | 17 | 11 | 24 | 6 | 7 |
      | Category D | 14 | 8 | 20 | 6 | 6 |
      | Category E | 7 | 2 | 12 | 5 | 5 |
      “`

      #### 3. **Create a Bar Chart:**
      – Select the **Categories** and **Mean** columns.
      – Go to the *Insert* tab and choose a **Bar Chart** (or **Column Chart**, depending on your preference).

      #### 4. **Add Error Bars:**
      – Click on the chart to activate it.
      – Go to the *Chart Tools Design* tab and select *Add Chart Element* > *Error Bars* > *More Error Bars Options*.
      – In the Error Bars window, choose **Custom**.
      – Select the **Lower Error** column as the negative error value and the **Upper Error** column as the positive error value.

      #### 5. **Customize the Error Bars:**
      – Adjust the appearance of the error bars (color, thickness, etc.) to make them more visible.
      – You can label the data points or add axis titles if needed.

      Now, you have a chart with bars representing the mean values, and error bars representing the confidence intervals for each category.

      This approach will allow you to input the specific **Lower CI** and **Upper CI** values into your Excel table without having to calculate the margin from the mean, giving you full control over the visualization of your data.

Leave a Reply

Your email address will not be published. Required fields are marked *