fbpx

How to add a line to column chart? [Charting trick]

Share

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Let’s say you work in super hero factory as floor manager. You are looking at the recent time sheet data submitted by your underlings and want to know who works more. So you did what any self respecting floor manager does. You made yourself a large cup of hot chocolate, whipped open Excel and created a column chart.

But now, you want to add a line to it at 6:00 PM (or some other arbitrary  point) so you can clearly see which superheros are over working.

column-chart-with-line

So how do you go about it?

Adding a line to column charts – Tutorial

This tutorial assumes you have a column chart. If you have a bar chart, you should use vertical error bars in step 6.

regular-column-chart

  1. In a cell, enter the value  for your line. Say this is in C15 (and it has 6:00 PM)
  2. Add this extra point to your chart. At this stage you will get this.
    after-adding-extra-series
  3. Take a sip of that scrumpdillycious  hot chocolate.
  4. Convert the new series to as XY chart. Just right click on it and select “Change series chart type”.
  5. Add error bars to this new dot
    adding-error-bars
  6. Excel adds both vertical & horizontal bars. We just need horizontal line. So remove vertical (Y) error bars.
    Note: if you are adding the line to bar chart, remove X error bars instead.
  7. Set error bar value to 7 (same as number of categories – 1)
    error-bar-before-formatting
  8. Format the error bar
    1. Set error bar to plus side only
    2. Remove cap
    3. Set the line color and thickness
    4. Remove marker symbol (set it to no marker) so we have only line
  9. Chug the rest of your hot chocolate, we are done!

Video tutorial – How to add a line to column chart

Watch this quick video tutorial on how to add a line to column chart to understand this process better.

You can also watch this video on Chandoo.org Youtube channel.

Download Example Workbook – Column chart with a line

Please click here to download example workbookPlay with the input data to see the chart change. Try to recreate the chart from scratch to master this technique.

Become a super hero of Excel charting

Unleash the super hero in you by learning few charting tricks and tips. Start with below, but be warned though. Everyone is going to love your charts.

How would you add a line to column charts?

Using error bars to add a horizontal line (or vertical) is just one of the many ways to do this. How would you add a line to column charts? Please share your techniques in the comments section.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Chandoo is an awesome teacher
5/5

– Jason

Excel formula list - 100+ examples and howto guide for you

100 Excel Formulas List

From simple to complex, there is a formula for every occasion. Check out the list now.

20 Excel Templates

Calendars, invoices, trackers and much more. All free, fun and fantastic.

IRR and data tables in Excel

Using IRR with Data Tables – Modeling Cash-flow Scenarios in Excel

Do you want to simulate multiple cash-flow scenarios and calculate the rate of return? Then this article is for you. In this page, learn how to,

  • Introduction to IRR & XIRR functions
  • Calculate rate of return from a set of cash-flows with XIRR
  • Simulating purchase or terminal value changes with data tables
  • Apply conditional formatting to visualize the outputs
  • Common issues and challenges faced when using XIRR

17 Responses to “How to add a line to column chart? [Charting trick]”

  1. kris maly says:

    Functionality is good.

    I wish you should display the Version of Excel that you are Demonstrating.
    I have Excel 2010 and it doesn't contain Error Bars.
    If I am wrong please let me know.

    Appreciate all you do and thanks for educating the community.

  2. bet says:

    Super simple: Add a line chart element to the chart and link to a new data set, all with same value for each superhero, hence displaying as a straight line.

  3. Sunny Kow says:

    I would prefer to add a third series, all 06:00 PM, and then change it to a line chart. It will give the same result.

    Sunny Kow

  4. Richard says:

    How would you add a range, say 5-6 shaded in light red for example?

  5. Blaz says:

    Chandoo, why not only add third series as @Sunny Kow already suggested?

    What is the difference?

    • Chandoo says:

      As I mentioned in the video, there are many ways to do this. I believe, I have covered the third series technique in a previous video or post. So I wanted to showcase the error bar technique. Also, the line chart method won't work with bar charts (as lines need different X/ category values). Hope that helps.

  6. David N says:

    To avoid the need to repeat the target time for every person and still end up with a line that runs all the way across the chart, follow these steps. Note: this line will truly extend all the way across the chart instead of stopping in the middle of the first and last categories as happens with Chandoo's example.

    Plot/move the new series to the secondary axes.

    Turn off the secondary vertical, leaving the secondary horizontal turned on but not shown (all display elements set to None) and with the setting to "Position Axis: On tick marks."

    From the Select Data dialog, enter the series (y) values for the line as =(SheetName!$C$15,SheetName!$C$15) or simply click that cell twice using the Ctrl key. Including the parentheses is important in allowing you to repeat the cell address.

    It will not be necessary to enter anything for the category (x) values.

  7. Sachin says:

    My boss wanted exactly this and I was looking for this...It gave the quick solution to my problem...Thanks!!

  8. arati says:

    Thanks...thanks...gave the speedy answer for my issue

  9. charu says:

    thanks for this post...it really useful for us...

  10. Dave says:

    Hi Chandoo,

    This is super helpful. Thanks for the post.

    On the other hand, are there any ways to make the line start from the left side of the first bar (the left side of the blue bar of Batman)?

    Thank you in advance!

Leave a Reply