The fastest way to add a line to your graph
To add a line to an existing Excel chart, right-click on the chart itself, select Edit Chart, then right-click on the data series (the bars or points) and choose Add Trendline. A panel opens on the right side where you pick the line type — Linear works for most cases — and click Close. The line appears instantly on your chart.
If you want a horizontal or vertical reference line instead of a trend line (like a target value or average), the process is slightly different: you add a new data series with the same value repeated down the column, then format it to appear as a line. Both methods take under a minute once you know where to click.
Key Takeaways
- A trendline shows the direction of your data and is added by right-clicking the data series inside an already-created chart.
- A reference line (horizontal or vertical) requires you to create a new column of data with the same value repeated, then add it as a second data series.
- After adding either type of line, you can change its color, thickness, and style by right-clicking the line itself and selecting Format Trendline or Format Data Series.
- Trendlines work best on scatter plots and line charts; reference lines work on any chart type.
Adding a trendline to show data direction
A trendline is a line that runs through or near your data points to show whether values are going up, down, or staying flat. Excel calculates this automatically once you tell it what kind of line you want.
First, click on your chart to select it. You will see a border around the chart and the chart tools appear in the ribbon at the top. Now right-click directly on one of the data points (a bar, a dot, or a point on a line) — not on the background. A menu appears. Select Add Trendline.
A panel labeled Format Trendline opens on the right side of your screen. Under Trendline Options, you see several choices: Linear, Exponential, Power, Polynomial, and Moving Average. For most business charts, Linear is the right choice — it draws a straight line that best fits your data. Click the Linear radio button if it is not already selected, then close the panel. The line appears on your chart.
Adding a reference line for a target or average
A reference line is a horizontal or vertical line that marks a specific value — like a sales target, a budget limit, or an average. Unlike a trendline, it does not follow your data; it stays at one fixed height or position.
To add a reference line, you first need to create a helper column with the value you want the line to sit at. For example, if your target is $50,000, type 50000 in a cell next to your data, then copy that value down for as many rows as your data has. Give this column a header like "Target".
Now select your chart and go to the Chart Design tab in the ribbon. Click Select Data. In the dialog that opens, click Add under the Legend Entries (Series) section. A Edit Series dialog appears. For Series name, type the name of your reference line (like "Target"). For Series values, select the cells in your helper column that contain the repeated value. Click OK twice to close both dialogs.
Your reference line now appears on the chart, but it is probably formatted as bars or points instead of a line. Right-click on the new series and select Change Series Chart Type. Choose Line from the list on the left, pick the line style you want (solid line, no markers), and click OK. The reference line is now visible as a straight line across your chart.
Changing the color and thickness of your line
Once your line is on the chart, you can make it stand out or blend in by changing its appearance. Right-click directly on the line itself — not on the chart background — and select Format Trendline (for a trendline) or Format Data Series (for a reference line).
A panel opens on the right. Look for Line options. You can change the Color by clicking the color box, adjust the Width by dragging the slider or typing a number, and change the Dash type to make it solid, dotted, or dashed. Most people make reference lines thicker or a different color so they stand out from the actual data. Close the panel when you are done.
Removing a line you no longer need
If you added a line by mistake or no longer want it, click on the line to select it (you will see small squares at the ends), then press Delete. The line disappears immediately.
If you added a reference line as a data series and want to remove it, right-click on the line, select Delete, and confirm. The series is removed from the chart and the legend.
Why your line might not appear
The most common reason a line does not show up is that you right-clicked on the chart background instead of on the actual data. Make sure you are clicking directly on a data point, a bar, or an existing line — you should see the point highlight or the series select before you right-click.
Another reason is that the line color matches your chart background. If you added a line but cannot see it, right-click on where the line should be and change the color to something darker or more visible. If you added a reference line as a data series and it is not showing, check that the series was actually added by looking at the legend — if it is not there, the series did not add correctly and you should try again.
Frequently Asked Questions
Can I add more than one line to the same chart?
Yes. You can add multiple trendlines by repeating the process for different data series, or multiple reference lines by creating separate helper columns and adding each as its own data series. Each line can have its own color and style.
What is the difference between a trendline and a reference line?
A trendline is calculated by Excel based on your actual data points — it shows the direction your data is moving. A reference line is a fixed value you set yourself, like a goal or average, and does not change based on your data.
Can I add a line to a pie chart or doughnut chart?
No. Trendlines only work on scatter plots, line charts, bar charts, and column charts. Pie and doughnut charts do not support lines because they do not have a numeric axis to measure against.
How do I make a line appear behind the data instead of on top of it?
Right-click on the line, select Format Trendline or Format Data Series, and look for a Layout or Arrange option. Some versions of Excel let you send the line backward. If that option is not available, try making the line lighter or more transparent so the data shows through.
Can I add a diagonal reference line?
Not directly with a reference line. If you need a diagonal line (like a break-even line on a profit chart), you would need to create a formula that calculates the y-value for each x-value, then add that as a data series and format it as a line.