Table of Contents
How to draw an average line in Excel graph
How to add a line to an existing Excel graph
How to plot a target line with different values
Tips to customize the line
Display the average / benchmark value on the line
Add a text label for the line
Change the line type
Extend the line to the edges of the chart area
Home Topics excel How to add a line in Excel graph: average line, benchmark, etc.

How to add a line in Excel graph: average line, benchmark, etc.

Apr 06, 2025 am 10:21 AM

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?".

How to draw an average line in Excel graph

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:

  1. Calculate the average by using the AVERAGE function.

    In our case, insert the below formula in C2 and copy it down the column:

    =AVERAGE($B$2:$B$7)

    How to add a line in Excel graph: average line, benchmark, etc.

  2. Select the source data, including the Average column (A1:C7).
  3. Go to the Insert tab > Charts group and click Recommended Charts.

    How to add a line in Excel graph: average line, benchmark, etc.

  4. Switch to the All Charts tab, select the Clustered Column - Line template, and click OK:

    How to add a line in Excel graph: average line, benchmark, etc.

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:

How to add a line in Excel graph: average line, benchmark, etc.

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:

How to add a line in Excel graph: average line, benchmark, etc.

Tips:

  • The same technique can be used to plot a median For this, use the MEDIAN function instead of AVERAGE.
  • Adding a target line or benchmark line in your graph is even simpler. Instead of a formula, enter your target values in the last column and insert the Clustered Column - Line combo chart as shown in this example.
  • If none of the predefined combo charts suits your needs, select the Custom Combination type (the last template with the pen icon), and choose the desired type for each data series.

How to add a line to an existing Excel graph

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.

  1. Insert a new column beside your source data. If you wish to draw an average line, fill the newly added column with an Average formula discussed in the previous example. If you are adding a benchmark line or target line, put your target values in the new column like shown in the screenshot below:

    How to add a line in Excel graph: average line, benchmark, etc.

  2. Right-click the existing graph, and choose Select Data… from the context menu:

    How to add a line in Excel graph: average line, benchmark, etc.

  3. In the Select Data Source dialog box, click the Add button in the Legend Entries (Series)

    How to add a line in Excel graph: average line, benchmark, etc.

  4. In the Edit Series dialog window, do the following:
    • In the Series namebox, type the desired name, say "Target line".
    • Click in the Series value box and select your target values without the column header.
    • Click OK twice to close both dialog boxes.

    How to add a line in Excel graph: average line, benchmark, etc.

  5. The target line series is added to the graph (orange bars in the screenshot below). Right-click it, and choose Change Series Chart Type… in the context menu:

    How to add a line in Excel graph: average line, benchmark, etc.

  6. In the Change Chart Type dialog box, make sure Combo > Custom Combination template is selected, which should be by default. For the Target line series, pick Linefrom the Chart Type drop-down box, and click OK.

    How to add a line in Excel graph: average line, benchmark, etc.

Done! A horizontal target line is added to your graph:

How to add a line in Excel graph: average line, benchmark, etc.

How to plot a target line with different values

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:

How to add a line in Excel graph: average line, benchmark, etc.

To visualize the target values more clearly, you can display them in this way:

How to add a line in Excel graph: average line, benchmark, etc.

To achieve this effect, add a line to your chart as explained in the previous examples, and then do the following customizations:

  1. In your graph, double-click the target line. This will select the line and open the Format Data Series pane on the right side of your Excel window.
  2. On the Format Data Series pane, go to Fill & Line tab > Line section, and select No line.

    How to add a line in Excel graph: average line, benchmark, etc.

  3. Switch to the Marker section, expand Marker Options, change it to Built-in, select the horizontal bar in the Type box, and set the Size corresponding to the width of your bars (24 in our example):

    How to add a line in Excel graph: average line, benchmark, etc.

  4. Set the marker Fill to Solid fill or Pattern fill and select the color of your choosing.
  5. Set the marker Border to Solid line and also choose the desired color.

The screenshot below shows my settings:

How to add a line in Excel graph: average line, benchmark, etc.

Tips to customize the line

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.

Display the average / benchmark value on the line

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:

  1. Click on the line to select it:

    How to add a line in Excel graph: average line, benchmark, etc.

  2. With the whole line selected, click on the last data point. This will unselect all other data points so that only the last one remains selected:

    How to add a line in Excel graph: average line, benchmark, etc.

  3. Right-click the selected data point and pick Add Data Label in the context menu:

    How to add a line in Excel graph: average line, benchmark, etc.

The label will appear at the end of the line giving more information to your chart viewers:

How to add a line in Excel graph: average line, benchmark, etc.

Add a text label for the line

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:

  1. Select the last data point on the line and add a data label to it as discussed in the previous tip.
  2. Click on the label to select it, then click inside the label box, delete the existing value and type your text:

    How to add a line in Excel graph: average line, benchmark, etc.

  3. Hover over the label box until your mouse pointer changes to a four-sided arrow, and then drag the label slightly above the line:

    How to add a line in Excel graph: average line, benchmark, etc.

  4. Right-click the label and choose Font… from the context menu.

    How to add a line in Excel graph: average line, benchmark, etc.

  5. Customize the font style, size and color as you wish:

    How to add a line in Excel graph: average line, benchmark, etc.

When finished, remove the chart legend because it is now superfluous, and enjoy a nicer and clearer look of your chart:

How to add a line in Excel graph: average line, benchmark, etc.

Change the line type

If the solid line added by default does not look quite attractive to you, you can easily change the line type. Here's how:

  1. Double-click the line.
  2. On the Format Data Series pane, go Fill & Line > Line, open the Dash type drop-down box and select the desired type.

For example, you can choose Square Dot:

How to add a line in Excel graph: average line, benchmark, etc.

And your Average Line graph will look similar to this:

How to add a line in Excel graph: average line, benchmark, etc.

Extend the line to the edges of the chart area

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:

How to add a line in Excel graph: average line, benchmark, etc.

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:

  1. Insert a new row before the first and after the last row with your data.
  2. Copy the average/benchmark/target value in the new rows and leave the cells in the first two columns empty, as shown in the screenshot below.
  3. Select the whole table with the empty cells and insert a Column - Line chart.

Now, our graph clearly shows how far the first and last bars are from the average:

How to add a line in Excel graph: average line, benchmark, etc.

Tip. If you want to draw a vertical line in a scatter plot, bar chart or line graph, you'll find the detailed guidance in this tutorial: How to insert vertical line in Excel chart.

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!

The above is the detailed content of How to add a line in Excel graph: average line, benchmark, etc.. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1662
14
PHP Tutorial
1261
29
C# Tutorial
1234
24
MEDIAN formula in Excel - practical examples MEDIAN formula in Excel - practical examples Apr 11, 2025 pm 12:08 PM

This tutorial explains how to calculate the median of numerical data in Excel using the MEDIAN function. The median, a key measure of central tendency, identifies the middle value in a dataset, offering a more robust representation of central tenden

Excel shared workbook: How to share Excel file for multiple users Excel shared workbook: How to share Excel file for multiple users Apr 11, 2025 am 11:58 AM

This tutorial provides a comprehensive guide to sharing Excel workbooks, covering various methods, access control, and conflict resolution. Modern Excel versions (2010, 2013, 2016, and later) simplify collaborative editing, eliminating the need to m

Google Spreadsheet COUNTIF function with formula examples Google Spreadsheet COUNTIF function with formula examples Apr 11, 2025 pm 12:03 PM

Master Google Sheets COUNTIF: A Comprehensive Guide This guide explores the versatile COUNTIF function in Google Sheets, demonstrating its applications beyond simple cell counting. We'll cover various scenarios, from exact and partial matches to han

Excel: Group rows automatically or manually, collapse and expand rows Excel: Group rows automatically or manually, collapse and expand rows Apr 08, 2025 am 11:17 AM

This tutorial demonstrates how to streamline complex Excel spreadsheets by grouping rows, making data easier to analyze. Learn to quickly hide or show row groups and collapse the entire outline to a specific level. Large, detailed spreadsheets can be

How to convert Excel to JPG - save .xls or .xlsx as image file How to convert Excel to JPG - save .xls or .xlsx as image file Apr 11, 2025 am 11:31 AM

This tutorial explores various methods for converting .xls files to .jpg images, encompassing both built-in Windows tools and free online converters. Need to create a presentation, share spreadsheet data securely, or design a document? Converting yo

Google sheets chart tutorial: how to create charts in google sheets Google sheets chart tutorial: how to create charts in google sheets Apr 11, 2025 am 09:06 AM

This tutorial shows you how to create various charts in Google Sheets, choosing the right chart type for different data scenarios. You'll also learn how to create 3D and Gantt charts, and how to edit, copy, and delete charts. Visualizing data is cru

Excel: If cell contains formula examples Excel: If cell contains formula examples Apr 09, 2025 am 09:04 AM

This tutorial demonstrates various Excel formulas to check if a cell contains specific values, including text, numbers, or parts of strings. It covers scenarios using IF, ISTEXT, ISNUMBER, SEARCH, FIND, COUNTIF, EXACT, SUMPRODUCT, VLOOKUP, and neste

How to do calculations in Excel How to do calculations in Excel Apr 11, 2025 am 10:20 AM

This tutorial demonstrates how to perform arithmetic calculations within Microsoft Excel and modify the order of operations in your formulas. Excel's capabilities extend far beyond simple addition; it can handle complex calculations, thanks to its h

See all articles