This short tutorial will walk you through adding a line in Excel graph such as an average line, benchmark, trend line, etc.
In the last week's tutorial, we were looking at how to make a line graph in Excel. In some situations, however, you may want to draw a horizontal line in another chart to compare the actual values with the target you wish to achieve.
The task can be performed by plotting two different types of data points in the same graph. In earlier Excel versions, combining two chart types in one was a tedious multi-step operation. Microsoft Excel 2013, Excel 2016 and Excel 2019 provide a special Combo chart type, which makes the process so amazingly simple that you might wonder, "Wow, why hadn't they done it before?".
This quick example will teach you how to add an average line to a column graph. To have it done, perform these 4 simple steps:
In our case, insert the below formula in C2 and copy it down the column:
=AVERAGE($B$2:$B$7)
Done! A horizontal line is plotted in the graph and you can now see what the average value looks like relative to your data set:
In a similar fashion, you can draw an average line in a line graph. The steps are totally the same, you just choose the Line or Line with Markers type for the Actual data series:
Adding a line to an existing graph requires a few more steps, therefore in many situations it would be much faster to create a new combo chart from scratch as explained above.
But if you've already invested quite a lot of time in designing you graph, you wouldn't want to do the same job twice. In this case, please follow the below guidelines to add a line in your graph. The process may look a bit complicated on paper, but in your Excel, you will be done in a couple of minutes.
Done! A horizontal target line is added to your graph:
In situations when you want to compare the actual values with the estimated or target values that are different for each row, the method described above is not very effective. The line does not allow you to pin point the target values exactly, as the result you may misinterpret the information in the graph:
To visualize the target values more clearly, you can display them in this way:
To achieve this effect, add a line to your chart as explained in the previous examples, and then do the following customizations:
The screenshot below shows my settings:
To make your graph look even more beautiful, you can change the chart title, legend, axes, gridlines and other elements as described in this tutorial: How to customize a graph in Excel. And below you will find a few tips relating directly to the line's customization.
In some situations, for example when you set relatively big intervals for the vertical y-axis, it may be hard for your users to determine the exact point where the line crosses the bars. No problem, just show that value in your graph. Here's how you can do this:
The label will appear at the end of the line giving more information to your chart viewers:
To improve your graph further, you may wish to add a text label to the line to indicate what it actually is. Here are the steps for this set up:
When finished, remove the chart legend because it is now superfluous, and enjoy a nicer and clearer look of your chart:
If the solid line added by default does not look quite attractive to you, you can easily change the line type. Here's how:
For example, you can choose Square Dot:
And your Average Line graph will look similar to this:
As you can notice, a horizontal line always starts and ends in the middle of the bars. But what if you want it to stretch to the right and left edges of the chart?
Here is a quick solution: double-click the on the horizontal axis to open the Format Axis pane, switch to Axis Options and choose to position the axis On tick marks:
However, this simple method has one drawback - it makes the leftmost and rightmost bars half as thin as the other bars, which does not look nice.
As a workaround, you can fiddle with your source data instead of fiddling with the graph settings:
Now, our graph clearly shows how far the first and last bars are from the average:
That's how you add a line in Excel graph. I thank you for reading and hope to see you on our blog next week!
21 responses to "How to add a line in Excel graph (average line, benchmark, baseline, etc.)"
can i put this line anywhere. I want this line to be moved from current location to other location. Is it possible. Please let me know. 9958612547
Hello, Amit.
Unfortunately, there is no way to move this line manually. However, if you change the values it refers to, it will be moved to the corresponding position automatically.
Please let us know if you have any other questions.
I can't get the last bit of your tutorial to work (Extending the line to the edges of the chart data). I did as you said but my axis labels are not lined up (i.e. the first label for the first bar with values in it is actually lined up with the empty bar beside it).
Never mind, got it to work!
HI,
Can you share your work around ?
I am facing the same issue
Hi all,
How to make trend line upto few bars in excel chart. I do not want trend line for entire bars what ever available in chart.
Regards,
Harinath
Hi, excellent tutorial as usual. I want to apply a single value target line to a CLUSTERED BAR chart but this method seems only to work with a column. Is there a method to apply the Custom Combo to a clustered column? Thanks
Hi Gordon,
If my understanding is correct you are looking to draw a vertical line in a bar chart, right? If so, we have just published the tutorial that explains how to do this:
How to add vertical line to Excel bar chart
Is there a way of adding a line without adding a whole column?
What if I have a single cell containing the benchmark. Is there a way that I can create this horizontal line from just this one cell. Rather than having to add a whole extra column with the same benchmark number listed multiple times.
Did you ever figure out how to do this?
hy how can i plote run chart
Hi All,
I have multiple data and i draw a excel graph.
My X axis vales are 10, 20 30 , 40 and corresponding Y axis vales are plotted.
Now I want to know through excel graph,what is the correspondence vale of 25.
Can anybody explain how to draw line.
Can you I get a limit line drawn in an Area Chart?
I have a spreadsheet that keeps track of scores to tests I took. I want a horizontal line on my chart at the 65 value, to visually show where my mark was relative to a passing grade. However, I don't want to add entire column titled "Passing grade" with a 65 written in every row, because it looks really ugly. I'd prefer to have a single box with the value 65 in it. However, when I try to use that box as a value in my chart in order to create the line, the line only shows over the first value in my chart, since the number 65 only appears once in my spreadsheet and is not written for each column. Is there any way to fix this?
Svetlana, thank you for the new tutorial! I have a chart with 3 series and I would like to add 3 additional series (average lines) one for each. Any suggestion?
It works the same way. Excel didn't allowed me to add the new series (lines) properly. Just redid the same chart. Thank you again!
Hi, I have the Length & Breadth of a Rectangle defined in cell A1 & B1 respectively. How do I draw the Rectangle on the current sheet using values defined in the cell A1 & B1?
Hello , i need to add diffrent categorie for my histogram,for exemple from 0 to 7 doubtfull,from 7 to 12 medieum and from 12 to 18 good .
Hello, is the demonstrated separate bars of target, by using Fill&Line and Marker, from Excel later than 2013? Is it possible to do the same thing in Excel 2013
Thank you, Svetlana! Super helpful!