30 Advanced Excel Tips for 2026

Excel Champs / Excel Charts / Add a Horizontal Line in a Chart
By Puneet Gogia (Microsoft MVP)

How to Add a Horizontal Line in a Chart in Excel

Add a helper column beside your values that repeats the line’s value on every row: =AVERAGE($B$2:$B$13) for an average line, or your target figure for a target line. Select the labels, values and helper together, go to Insert → Charts and pick Clustered Column.

Right-click any helper bar, choose Change Series Chart Type, set the helper series to Line and leave your values as Clustered Column. In Excel 2013 and later this is the Combo option in the same dialog. The helper turns into a flat line at the average or target.

To compare each column with its own target, put the monthly targets in the helper instead. Then open Format Data Series → Fill & Line, set Line to No line, and under Marker → Marker Options choose Built-in with the long dash shape and a larger size. Each target then shows as a short bar across its own column.

A line series stops at the centre of the first and last columns. To run it edge to edge, move the helper to the secondary axis, add the secondary horizontal axis from Chart Elements → Axes, set its Axis position to On tick marks, then hide its labels and give both vertical axes the same minimum and maximum.

If the line slopes or steps, the AVERAGE range moved as you filled down: lock it with $ as above. If the line sits at the wrong height, it is on a secondary axis with its own scale, so match the two vertical axes or untick Secondary Axis for that series.

While creating a chart in Excel, you can use a horizontal line as a target line or an average line. It can help you to compare achievement with the target. Just look at the chart below.

how to add horizontal line to excel chart using best practices

You like it, right? Say “Yes” in the comment section if you like it. OK, so listen: Let’s say you have an average value which you want to maintain in your sales throughout the year. Or, a constant target which you want to show in a chart for all the months.

In this case, you can insert a straight horizontal line to present that value. Here’s the thing: This horizontal line can be a dynamic one that will change its value or a line with a fixed value. And in today’s post, I’m going to show you exactly how to do this.

I’m going to share with you how you can insert a fixed as well as a dynamic horizontal line in a chart.

Add an Average [Horizontal] Line to a Chart

An average line plays an important role whenever you have to study some trend lines and the impact of different factors on the trend. And before you create a chart with a horizontal line, you need to prepare the data for it.

Before I tell you about these steps, let me show you how I am setting up the data. Here I am using a dynamic chart to show you how this will help you to make your presentation super cool. (download this dynamic data table from here) to follow along.

Use Data Table To Add Horizontal Line To Excel Chart

In the above data tables, I am getting data from the raw table to the dynamic table by using a VLOOKUP MATCH. Every time I change the year in the dynamic table, it automatically changes the sales values, and the average is calculated on those sales figures.

Below are the steps you need to follow to create a chart with a horizontal line.

The average column has the same value in every row. If you build it yourself, use the following formula in the first row (with the sales in B2:B13) and drag it down. The $ signs keep the range fixed, so every row gets the same average:

=AVERAGE($B$2:$B$13)
  1. First of all, select the data table and insert a column chart.
  2. Go to Insert ➜ Insert Column or Bar Chart ➜ 2-D Column ➜ Clustered Column, or you can also use Alt + F1 to insert a chart.
  3. So now, you have a column chart in your worksheet like below.
    Insert A To Add Horizontal Line To Excel Chart
  4. The next step is to change the average bars into a horizontal line.
  5. For this, select the average column bar and go to → Chart Design → Type → Change Chart Type.
    Go To Design Tab Add Horizontal Line To Excel Chart
  6. Once you click on the Change Chart Type option, you’ll get the Change Chart Type dialog box.
  7. Change the chart type of the average from “Clustered Column” to “Line with Markers”.
    Change Chart Type To Add Horizontal Line To Excel Chart
  8. Click OK.

Here is your ready-to-rock column chart with an average line and make sure to download this sample file from here.

How To Add Horizontal Line To Excel Chart Using Best Practices

One of my colleagues uses this same method to add a median line. You can also use this method to add an average line in a line chart. The steps are totally the same; you just have to insert a line chart instead of a column chart. And you will get something like this.

Add Horizontal Line To Excel Chart In A Line Chart

Add a Horizontal Target Line in Column Chart

One more method which I often use in my charts is adding a target line. There are several other ways to create a Target Vs. Achievement chart, but the target line method is simple & effective. First of all, let me show you the data which I am using to create a target line in the chart.

add horizontal line to excel chart to present a horizontal line

I have used the above table to get the target and actual figures from the month-wise tables and make sure to download the sample file from here. Now let’s start with the steps.

  1. Select the dynamic table which I have mentioned above.
  2. Insert a column chart. Go to Insert → Insert Column or Bar Chart → 2-D Column → Clustered Column.
  3. You’ll get a chart like below.
    Add Horizontal Line To Excel Chart To Insert A Target Line
  4. Now, you have to change the chart type of target bar from ​Clustered Column to Line with Markers​. To change the chart type, please use the same steps which I have used in the previous method.
  5. After changing the chart type, your chart will look something like this.
    Add Horizontal Line To Excel Chart In Target Line In Line Chart
  6. Now, we have to make some changes in this line chart.
  7. After that, make a double click on the line to open the formatting options. Once you do that, you’ll get the Format Data Series pane.
  8. Make the following changes in formatting.
    1. Go to → Fill & Line → Line.
    2. Change line style to “No Line”.

    Change Line Type In Line Chart To Add Horizontal Line To Excel Chart
  9. Now, go to the Marker section and make the following changes.
    1. Change marker type to Built-In, a horizontal bar, and size 25.
    2. Marker fill to solid fill.
    3. Use white color as the fill color.
    4. Set the border to a solid line.
    5. And, black color for borders.

    Make Changes Add Horizontal Line To Excel Chart
  10. Once you make all the changes to the line you’ll get a chart like I have below.
    Add Horizontal Line To Excel Chart With Target Line

Congratulations! Your chart is ready.

Make the Line Cover the Full Width of the Chart

With the first method, the average line starts in the middle of the first column and ends in the middle of the last one. To stretch it from edge to edge:

  1. First of all, select the average line and go to Format Data Series ➜ Series Options ➜ Plot Series On ➜ Secondary Axis.
  2. After that, click the Chart Elements (+) button ➜ Axes and tick Secondary Horizontal.
  3. Next, select the new top axis and set Format Axis ➜ Axis Options ➜ Axis position to “On tick marks”.
  4. In the end, set the minimum and maximum of the secondary vertical axis to the same values as the primary one, and hide the secondary axes (Labels ➜ None).

Add a Fixed Target Line from a Cell

If your target is one number for the whole year, type it in a cell (like E1) and fill a target column with a formula that points to it. When you change E1, the line moves with it:

=$E$1

Then change this series to a line, just like the average line above.

Frequently Asked Questions

Why is my average line not straight?

The average formula isn’t locked, so each row calculates a different average. Use $ signs in the range, like =AVERAGE($B$2:$B$13), so every row has the same value.

Can I add a horizontal line without a helper column?

You can draw a line with Insert ➜ Shapes, but it doesn’t move when the data changes. A helper column (average or target) keeps the line tied to the values.

How do I show the value of the line?

Click the last point of the line (click the line once, then once more on the point), and add a data label from the Chart Elements (+) button. This shows the average or target only once, at the end of the line.

14 thoughts on “How to Add a Horizontal Line in a Chart in Excel”

  1. It will help if you start by showing the end result formula first and then explain the moves.

    I did not understand a thing of what you said.

    I simply asked the question “how do you add horizontal lines on Excell”

    Reply
  2. Hi,

    I use this method and find that with a very large data set (many years) showing an average and a target line slows down the spreadsheet.

    Is there a way of having a horizontal average line and a horizontal target line by just calculating and then joining the first and last values with a straight line?

    Reply
  3. Really cool entry you have made my friend. Thank you so much from TURKEY.

    Reply
  4. How the year changes by radio button click. Can you explain?

    Reply
  5. Can you please explain how you create the year option like 2010,2011.. etc on first excel chart?

    Reply
  6. I have a horizontal line of averages for my FitBit steps per day.
    I now have thousands of days and it takes a long time to calculate the average for all days.
    Is there a way of just calculating the first point and last point and plotting a straight line?

    Reply

Leave a Comment