To add error bars to a line chart in Excel for Microsoft 365 on Windows, select the chart, then choose Chart Design > Add Chart Element > Error Bars and select an option. For values you calculate yourself, choose More Error Bar Options, select Custom, and specify the cells containing the positive and negative error amounts.
What error bars show on a line chart
A line chart displays values across categories or time, while error bars add a visual range around each plotted point. They can show the spread of observations, an estimate of uncertainty in a mean, or another range that you define. The bars do not change the line’s values; they add context to how those values should be read.
For example, a chart might show average response time for five days. A point gives the average for a day; its error bar could show a standard deviation, standard error, or confidence interval. Those choices communicate different things, so the chart should state which measure the bars represent. A viewer cannot reliably infer the meaning from the shape alone.
Error bars are not automatically proof that two groups differ significantly. Overlapping bars do not always mean there is no statistically significant difference, and non-overlapping bars do not replace a formal statistical test. Their interpretation depends on the data, the measure selected, and the question being asked.
Prepare the chart data first
Make sure the chart’s plotted values are the same statistics that your error bars describe. If each point is a mean, for instance, calculate an error measure for each mean from its underlying observations. A worksheet might contain dates in column A, mean values in column B, and error amounts in column C. For custom bars, the error range must contain one appropriate amount for each point in the series.
For a symmetrical range, the positive and negative error amounts are equal. For an asymmetric range, calculate the distances above and below each plotted value separately. If a point is 10 and its interval runs from 8 to 13, the negative error amount is 2 and the positive amount is 3. Excel expects those distances, not the lower and upper endpoint values themselves.
To calculate a standard error from five observations in B2:B6, with those cells containing one group’s measurements, use =STDEV.S(B2:B6)/SQRT(COUNT(B2:B6)). For the illustrative values 8, 10, 9, 11, and 12, the sample standard deviation is about 1.581 and the standard error is about 0.707. If the plotted point is the mean of those same values, its mean is 10. Keep the underlying observations and summary values organized so you can check what each plotted bar represents.
Add error bars to a line chart
- Click the line chart. To apply bars to a particular line when the chart has multiple series, click one of that series’ data points so the series is selected.
- On the ribbon, choose Chart Design > Add Chart Element > Error Bars.
- Choose a listed option, such as Standard Error, Percentage, or Standard Deviation, or choose More Error Bar Options to open the formatting pane.
- In the pane, confirm that the intended series is selected. Use the controls under Error Amount to choose the calculation or custom values you need.
The built-in choices are convenient, but they do not know the scientific or business meaning of your data. For example, Standard Deviation describes variation in observations, while Standard Error describes the estimated precision of a mean. The Percentage option uses a percentage of the plotted values; it is not a confidence interval. Check the resulting bars against your intended interpretation before sharing the chart.
Excel’s ribbon can show contextual Chart Design and Format tabs only while a chart is selected. If you do not see Chart Design, click the chart again. In Excel for Mac, select the chart and use the Chart Design tab’s Add Chart Element controls; the pane and some labels can differ slightly by release. Excel for the web has more limited chart editing than the desktop app, so use the Windows or Mac desktop version if the custom error-bar controls are unavailable.
Set custom and asymmetric error bars
Custom error bars are useful when each point has its own uncertainty or when the upper and lower ranges differ. In the Format Error Bars pane, select Custom under Error Amount, then choose Specify Value. In the resulting dialog, enter or select the cell ranges for Positive Error Value and Negative Error Value. You can select worksheet cells with the mouse rather than typing the references.
The positive and negative ranges should match the number of points in the selected series. If the chart series has five points, each error range should supply five values in the same order. Use a separate pair of ranges for each series when the series have different errors. A range containing endpoint values rather than error distances can produce oversized or otherwise misleading bars.
For example, suppose a line has three plotted means in B2:B4, and the upper error distances are in C2:C4 while the lower distances are in D2:D4. Select C2:C4 for Positive Error Value and D2:D4 for Negative Error Value. Excel applies the first pair to the first point, the second pair to the second point, and so on. If you insert or rearrange data later, revisit the chart’s ranges and confirm they still point to the intended cells.
Choose the right error-bar measure
Use a measure that answers the question behind the chart rather than choosing the option that looks clearest. Common choices have distinct meanings:
- Standard deviation: describes variation among observations. It can be useful when the spread of the data itself matters.
- Standard error: describes the estimated sampling variability of a statistic such as a mean. It is often smaller than the standard deviation as sample size increases.
- Confidence interval: gives an interval produced by a specified statistical method and confidence level. Calculate it in the worksheet and use custom bars if Excel’s built-in options do not match that method.
- Percentage or fixed value: can be suitable for a defined display rule or known measurement tolerance, but should be labeled so readers understand what it represents.
Excel’s built-in Standard Deviation and Standard Error options are quick chart calculations, not a substitute for documenting a study’s method. When points represent separate groups, the relevant uncertainty should normally be calculated for each group using its underlying observations. A single chart-wide setting may not communicate group-specific sample sizes, assumptions, or confidence levels as clearly as custom values do.
Format bars for a readable chart
After adding the bars, use the Format Error Bars pane to control their direction, end style, and appearance. Direction can be set to both, plus, or minus; the end style can include caps or omit them. Available controls depend on the chart and error-bar selection. Formatting changes the display, not the underlying error calculation.
Keep the bars visible without letting them overwhelm the data. A thin line in a contrasting but restrained color often works better than a heavy stroke. If bars collide with neighboring series or obscure markers, consider using distinct marker shapes, lighter colors, or separate panels. Do not remove bars merely because they make a preferred result look less dramatic.
Label the measure in the chart title, subtitle, legend, or a nearby note. For example, “Mean response time; bars show standard error” is more informative than “Error bars.” Include units where needed, and state the confidence level for intervals. If readers need to compare individual observations, showing the underlying points alongside means can make the distribution clearer than summary bars alone.
Common problems and how to fix them
- The bars appear on the wrong line: select the intended series before opening Error Bars. In a chart with several lines, Excel may apply formatting only to the currently selected series.
- Custom ranges are rejected: check that both ranges contain the same number of numeric values as the selected series has points. Remove unintended blanks, text, or header cells.
- The bars are much too large: check whether you entered lower and upper endpoints instead of distances from each plotted point. Also verify that the range units match the plotted values.
- Only one set of bars appears: check the selected series and whether the chart type supports the error bars you want. Line charts primarily use vertical, or Y, error bars because their horizontal positions are categories.
- The bars seem to change unexpectedly: inspect the source cells and chart references after editing or sorting the worksheet. Custom error bars rely on those cell references.
A line chart uses category positions on its horizontal axis, so it is generally not the right chart type for horizontal uncertainty in X values. If both X and Y coordinates are numeric and both need error bars, consider an XY (Scatter) chart instead. Scatter charts are designed for numerical horizontal and vertical axes and provide more appropriate controls for that situation.
Line charts, scatter charts, and alternatives
Use a line chart when the horizontal axis represents ordered categories such as dates, months, or stages, and the emphasis is on change across that sequence. Error bars then describe uncertainty or variation in the vertical values at each category. If the horizontal values are measurements rather than ordered labels—for example, concentration or distance—and their uncertainty matters, an XY scatter chart is usually a better fit.
Error bars are also not the only way to show uncertainty. A shaded band can communicate an interval across a continuous series, although creating and formatting one may take more setup. A table beside the chart can provide exact interval endpoints, sample sizes, or other detail that would clutter the visual. Choose the form that makes the data and its limitations easiest to understand, not simply the one that requires the fewest clicks.
Frequently Asked Questions
Can I add error bars to every line in an Excel chart?
Yes. Add or configure error bars for each data series, selecting the series before choosing the error-bar settings. If each line needs different custom values, assign the appropriate positive and negative ranges separately for each series.
How do I add 95% confidence interval bars in Excel?
Calculate the lower and upper error distances for each plotted point using the statistical method appropriate to the data and desired confidence level. Then choose Custom > Specify Value and supply the distance ranges. Excel’s Standard Error option is not automatically a 95% confidence interval.
Should I use standard deviation or standard error?
Use standard deviation when the goal is to show how observations vary. Use standard error when the goal is to describe uncertainty in an estimated statistic, commonly a mean. State the choice clearly because the two measures answer different questions.
Why are my custom error bars not the same length?
That is expected if the selected cells contain different amounts for different points, or if the positive and negative ranges differ. Check the cell references and order if the variation is unexpected; Excel uses the values supplied for each point.
Can a line chart show horizontal error bars?
A standard line chart’s horizontal axis is a category axis, so it is not designed to show uncertainty in numeric X values in the same way as a scatter chart. For uncertainty in both coordinates, use an XY (Scatter) chart and configure its error bars.
Related
- Excel PivotChart Without a PivotTable: What Actually Works
- Excel Cell Dropdown: Create a Pick List and Use It
- Excel Consolidate Rows With the Same Value
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Excel Gantt Chart Start and End Dates ExplainedIn an Excel Gantt chart, each task’s start date sets the bar’s position on the timeline, and its…
- Excel Pivot Table Not Grouping Dates? Causes and FixesIf Excel will not group dates in a PivotTable, first check the source date column for blanks, errors,…
- Add a Filter to an Excel Line Chart: How It Really WorksTo add a filter to an Excel line chart in Microsoft 365 for Windows, select the chart, click…
- Google Sheets Gantt Chart Tutorial: Build a Project TimelineTo make a Gantt chart in Google Sheets, put each task and its start and end dates in…
- Excel Gantt Chart Setup: Build a Project TimelineTo set up a Gantt chart in Excel, list each task with a start date and finish date,…
- Excel Sparkline Shortcut: Insert Line, Column, or Win/LossIn Excel for Microsoft 365 on Windows, select the cell where the sparkline should appear, then press Alt,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.