To create a horizontal line in an Excel chart, add another data series whose value is the same for every category, then format that series as a line. In Excel for Microsoft 365 on Windows, select the chart and choose Chart Design > Select Data > Add; point the new series to the repeated values. This makes a data-linked line that can represent a target, limit, or average and updates when the chart data changes.
Choose the kind of horizontal line you need
Before changing the chart, decide what the line is meant to show. A target line might sit at 100 units, a maximum limit at 250, or an average at the mean of the plotted observations. The intended meaning determines whether the line should use a fixed number or a formula, and whether it needs to follow the chart’s data.
- Fixed reference: Use the same entered value in each helper cell, such as 100 for a sales target.
- Calculated reference: Use a formula such as an average so the line changes when the underlying observations change.
- Visual annotation: Draw a shape over the chart if the line is only a presentation mark and does not need to represent data.
For most analytical charts, a data series is the better choice. It appears in the chart’s legend, can be formatted separately, and moves with the plotted data. A drawn shape can be quicker, but it is not connected to values or the vertical axis; resizing the chart or changing its scale can leave the shape in the wrong place.
Prepare a helper series in the worksheet
A helper series is a row or column of values that Excel plots as an additional series. For a chart with one point per month, make one helper value for every month. The helper values must line up with the chart categories: six months need six values in the same order, not one value or a mismatched range.
For example, suppose A2:A7 contains six month labels and B2:B7 contains the corresponding sales figures. Put Target in C1, enter 100 in C2:C7, and use the existing month labels and sales series when you add the new series. Excel will plot a value of 100 above each month. If the target differs, replace 100 with the intended threshold. For a chart that already uses a source table, you can add the helper column to that table and extend the chart’s source range if Excel does not include it automatically.
For a calculated average, with the six observations in B2:B7 and the helper series beginning in C2, enter =AVERAGE($B$2:$B$7) in C2, then fill it down through C7. The six example values 10, 12, 11, 15, 14, and 13 total 75; 75 divided by 6 is 12.5, so the formula returns 12.5 in each helper cell. The dollar signs keep the average range fixed as you fill down. If you want an average over a different set of observations, adjust the range to match the data you intend to summarize.
Add the line to a standard chart
- Click the chart to show its chart tabs, then choose Chart Design > Select Data.
- In the Select Data Source dialog, choose Add under Legend Entries (Series).
- In Edit Series, enter or select the helper column heading for Series name, then select the repeated values for Series values. Use the value cells only, not the heading.
- Choose OK to close Edit Series, and choose OK again to return to the chart.
- If needed, choose Chart Design > Change Chart Type and set the new series to a line type. In a standard line chart, Excel commonly plots an added series as a line already; check the result rather than assuming the chart type.
The new series should run across the same categories as the original data. If the chart has a category axis, such as dates or product names, the values are plotted in the order of those categories. If the chart shows unexpected category labels, check the source ranges in Select Data and confirm that the helper values match the original category count and ordering.
Use an average, target, or limit as the reference
A constant-value helper column works well for a target or threshold. A formula-based series is useful when the reference should recalculate. For example, an average line can help show whether monthly results are generally above or below the overall mean. The formula in the previous example calculates one average across all six observations, rather than a separate running average for each month.
That distinction matters. A horizontal line represents one value repeated across the chart. A running average or other changing benchmark is not horizontal; its helper values vary by category, and Excel will plot it as a changing line. Make sure the series matches the message you want the chart to communicate. Also consider whether blank or filtered observations should be included in the calculation: AVERAGE ignores blank cells but includes numeric values in the selected range.
For a target that is stored in one cell, you can refer to that cell in each helper row instead of typing the target repeatedly. This makes it easier to change the target later, because the chart series recalculates from the referenced value. Keep the target cell outside the chart’s category range if adding it would accidentally create an extra category or series.
Format the line so it reads clearly
Click the new line in the chart to select the series. If it is hard to select, click the chart and use Format > Current Selection to choose the series by name. Then open the Format Data Series pane and adjust the line color, width, and dash style. A contrasting color and a slightly heavier line often make a reference visible without competing with the main data.
For a line chart, turn off markers if Excel displays a marker at every category and you want one uninterrupted reference. In the formatting pane, look under the series’ marker options and choose no marker. Keep the series name meaningful, such as Target or Overall average, because that name can appear in the legend. If the legend is unnecessary, you can remove it or edit the series name, but avoid leaving an unexplained entry.
Check the vertical scale after adding the line. A target far outside the data range can expand the axis and make normal variation look small. Conversely, manually setting a minimum or maximum that excludes the reference can hide it. The line should remain visible and the scale should still convey the data honestly; do not change an axis merely to make results appear more dramatic.
Scatter charts and other chart types
An XY scatter chart uses numeric X and Y coordinates rather than category positions. For a horizontal reference in a scatter chart, add a series with two X values at the left and right ends of the plotted range, and the same target value for both Y values. In Chart Design > Select Data, add the series and edit it to assign the X values and Y values. Set that series to a scatter type with straight lines, and remove its markers if appropriate. The line will span between the two X endpoints.
Because scatter axes are numeric, check the X-axis minimum and maximum after adding the endpoints. If the axis range changes later, the two endpoints may no longer reach the chart edges; update the helper X values or use axis bounds that match the intended range. A regular line chart can look similar to a scatter chart, but it spaces categories evenly even when their labels are dates or numbers. Use the chart type that matches the meaning of the horizontal axis.
Some chart types do not support a conventional added line series in the same way. For example, a pie chart has no numeric vertical axis on which to place a target line. Consider changing to a chart type that can display the comparison, or use a clearly labeled shape as a visual annotation when the chart itself cannot represent the value.
Data series versus a drawn shape
A data series is usually the most reliable way to create a horizontal line because its height is tied to a value on the axis. If you change the data, target, or axis scale, the line remains at the corresponding value. It can also be included in the legend and formatted independently. This approach is appropriate for dashboards, recurring reports, and charts that other people may update.
A shape can be useful for a one-off slide or a chart that needs an approximate visual divider. Select the chart first, then use Insert > Shapes and choose a line. Drawing while the chart is selected generally anchors the shape to the chart object, but the line still does not know the value it represents. Its position is based on the drawing area, not the axis scale. If the axis range changes or the chart is resized, verify its position and label it so readers do not mistake it for a precise data series.
Common problems and how to fix them
- The line does not appear: Confirm that the series contains numbers, that its range is correct, and that it is assigned to a chart type that displays lines. A text value or an empty range will not create the intended reference.
- The line appears as separate points: The series may be using markers without a connecting line. Change its chart type to Line, or use a scatter subtype with straight lines for an XY chart.
- The chart scale changes dramatically: Check that the helper cells contain the intended value and that no accidental zero or unusually large value was included. A genuine target outside the original range will expand the axis by design.
- The line is offset from the categories: Make sure helper values have the same number and order as the category labels. For a table, check that the new helper column is included in the chart source.
- The line vanishes when the chart is filtered: Review the chart’s hidden and empty cell settings and whether the helper values are in the same filtered table. The behavior can depend on how the chart’s source data is arranged.
When troubleshooting, select the series and inspect its source range through Chart Design > Select Data. This is often more useful than rebuilding the chart. If the chart uses a secondary vertical axis, check both axes: a series plotted on the secondary axis can sit at a different visual height even if its numeric value is the same as a value on the primary axis. Keep the reference and the data it describes on the same axis unless there is a clear reason not to.
Frequently Asked Questions
Can I add a horizontal line without changing the source data?
You can use a drawn line from Insert > Shapes, but it is only a visual mark. For a data-linked line, add helper values in worksheet cells; you can put them in a separate area rather than alongside the original data, then include that range in the chart.
How do I add a horizontal average line in Excel?
Create a helper series that repeats the average of the observations for every category, then add it with Chart Design > Select Data > Add. For example, with values in B2:B7, use =AVERAGE($B$2:$B$7) in the first helper cell and fill it down to match the categories.
Can the line update automatically when I change the target?
Yes. Put the target in a worksheet cell and make each helper value refer to that cell, or use a formula that calculates the benchmark. The chart updates when Excel recalculates the linked cells.
Why does my horizontal line slope?
Its helper values may not all be identical, or the series may be plotted against a different axis or category order. Check the helper range, series chart type, and primary or secondary axis assignment.
How do I put a horizontal line on an Excel scatter chart?
Add a scatter series with two X coordinates spanning the desired chart width and the same Y value for both points. Use a scatter-with-straight-lines type and verify that the X-axis bounds include both endpoints.
Related
- Build an Enum from Excel Data: Practical Guide and Checks
- Import Emails From Outlook: PST and Account Options
- Examples of Ratings in Excel: Scores, Stars, and Rules
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Excel Pivot Table: How to Keep Formatting on RefreshTo keep formatting when an Excel PivotTable refreshes, select the PivotTable, open PivotTable Analyze > Options, and on…
- How to Make a Large Org Chart in PowerPointTo make a large org chart in PowerPoint, first organize the reporting structure, then use Insert > SmartArt…
- Make Charts in Excel the Same Size: A Step-by-Step GuideTo make several charts the same size in Excel for Microsoft 365 on Windows, select their chart borders…
- How to Make a Column Graph in Google Sheets: A GuideTo make a column graph in Google Sheets, select your data, choose Insert > Chart, then select Column…
- Excel Cumulative Line Graph: How to Create OneTo make a cumulative line graph in Excel, add a running-total column beside your values, then chart the…
- Excel Chart With Drop-Down List: How to Create OneYes. In Excel for Microsoft 365 on Windows, create a drop-down with Data Validation, use a helper column…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.