Sometimes while presenting data with an Excel chart we need to highlight a specific point to get the user’s attention there. And the best way for this is to add a vertical line to a chart.
Yes, you heard it right. You can highlight a specific point on a chart with a vertical line. Just look at the below line chart with 12-months of data.
Now, you know the benefit of inserting a vertical line in a chart. But the point is, which is the best method? Well, out of all the methods, I’ve found this method (which I have mentioned here) simple and easy.
Without any further ado here are the steps and please download this sample file from here to follow along.
Steps to Insert a [Static] Vertical Line a Chart
Here you have a data table with monthly sales quantity and you need to create a line chart and insert a vertical line in it. Please follow these steps.
- Enter a new column beside your quantity column and name it “Ver Line”.
- Now enter a value “100” for Jan in “Ver Line” column.
- Select the entire table and insert a line chart with markers.
- You’ll get a chart like this.
- Now select the chart and open the “Chnage Chart Type” options from Design Tab.
- After that change chart type to secondary axis and chart type to “Column Chart”
- Now next thing is to adjust axis values for your column bar.
- Double click on your secondary axis to open formatting options.
- Change the maximum value to 100, as we have entered the same value in Ver Line column.
- In same axis options, move down to label position and select none (This will hide secondary axis, yup we don’t need it).
- Last but not least, we have to make our column bar little thin so that it will look like a line.
- Click on the data bar, go to series option and increase your “Gap Width” to 500%.
Congratulations! You have successfully added a vertical line to your chart. You can download this sample file from here to learn more about this.
Quick Tip: Just enter 100 in the cell where you want to add a vertical line. If you want to add a vertical line in Feb instead of May, just enter the value in Feb.
Steps to Add a [Dynamic] Vertical Line in a Chart
Now it’s time to level up your chart and make a dynamic vertical name. Please follow these simple steps for this.
- First of all, you need to insert a scroll bar. Go to developer tab ➜ Insert ➜ Scroll bar.
- Right-click on your scroll bar and select format control.
- Link your scroll bar to cell C10 and enter 12 for maximum value.
- In the end, click OK.
- After that go to your data table and insert this formula [=IF(MATCH($A2,$A$2:$A$13,0)=$D$1,100,””)] to cell C2 (Formula Bar) and drag down up to the last cell of the table.
- Now you can use the scroll bar to navigate your vertical line in your chart. You can download this sample file from here to learn more about this.
Conclusion
As I said, adding a vertical line in a chart is useful when you want to highlight a specific data point in your chart. There are also some other ways to add a vertical line but I found this method quick and easy. I hope this charting tip will help you to get better at Excel.
Have you ever tried to do this before with your chart?
Please share your views in the comment section I would love to hear from you and please don’t forget to share this tip with your friends.
More Charting Tips and Tutorials
- How to Add a Horizontal Line in a Chart in Excel
- How to Create a Bullet Chart in Excel
- How to Create a Dynamic Chart Range in Excel
- How to Create a Dynamic Chart Title in Excel
- How to Create Interactive Charts In Excel
- How to Create a Sales Funnel Chart in Excel
- How to Create a HEAT MAP in Excel
- How to Create a HISTOGRAM in Excel
- How to Create a Pictograph in Excel
- How to Create a Milestone Chart in Excel
- How to Insert a People Graph in Excel
- How to Create PIVOT CHART in Excel
- How to Create a Population Pyramid Chart in Excel
- How to Create a SPEEDOMETER Chart [Gauge] in Excel
- How to Create a Step Chart in Excel
- How to Create a Thermometer Chart in Excel
- How to Create a Tornado Chart in Excel
- How to Create Waffle Chart in Excel
Amazing tutorial. I learned a lot from it!
Great tutorial! Many thanks for your contributions!
Thanks a lot. This method works better and faster. More than that, I love the comment section of your articles because the answers provided gives me an added lesson that I would one day live to confront and them solve.
Thanks again
very interesting and informative..thankyou for posting this
I try to drag the formula in C2 to add dynamic vertical line.But in the cell the message come as #Name ?.Pl help
Try it with the sample file.
Puneet you may not see this but thank you this worked great.
I’m so glad you liked it. 🙂
Hi, I’ve had a play with this and the concept makes a lot of sense. This is handy. However, I’ve now got another issue for mine.
What if my graph also includes negative values? This works well when all values are positive, but my graph actually includes negatives! Thanks in advance.
This solution works for the dynamic version of the chart:
In that case, I believe you should have a condition if the value in the selected cell (which you are selecting with a scroll bar) has a negative value then the value for the vertical line also be negative.
Ingenious and Intersting!
I could have used it had I known it a year earlier! When I was updating numerous charts on a weekly basis to depict various facets of my project. My X-Axis was always fixed to span entire 18 month project life span. And I was using an actual vertical line to depict the Status Date and would move it physically on all the charts. The scroll button would have been more professional!
Is it possible to move the line on multiple charts using the same scroll button?
Yes you can. Let’s say if you have 1 to 12 scroll bar numbers for the first chart then you can use 13 to 24 for the second chart.
Thanks’ I make use of this.
Welcome.
I’m so glad you found this post helpful!
Thanks Puneet, nice sharing and I second your statement it is an easy method.
Hey Asif,
Thanks for your words.