How to add a vertical line to an Excel chart
A vertical line in an Excel chart marks a specific point on the horizontal axis — a deadline, a threshold, a change in policy, or any moment you want to highlight. Excel doesn't have a built-in "vertical line" tool, but you can add one in about two minutes using a data series formatted to look like a line. The method works in Excel 2016, 2019, 2021, and Excel Online.
The process involves creating a small helper column with two identical values, adding that data to your chart as a new series, then formatting it to appear as a thin vertical line. Once it's in place, you can move it by changing the values in your helper column, and you can format it any color or style you want.
Key Takeaways
- You create a vertical line by adding a two-row helper column with the same X-axis value repeated, then adding that as a new data series to your chart.
- The helper column needs only two cells: one with your target date or number, and one directly below it with the same value.
- After adding the series to the chart, you format it as a line with no markers, then adjust the line color and thickness to match your design.
- You can move the vertical line by editing the values in your helper column — change the date or number, and the line moves with it.
- This method works with column charts, line charts, and combination charts, but the helper column must use the same axis scale as your main data.
Set up your helper column with two matching values
Open your spreadsheet and locate an empty column to the right of your data. This is where you'll create the vertical line. In the first cell of this column, type the value where you want the line to appear — this could be a date (like 1/15/2024), a number (like 50), or any point on your chart's horizontal axis. In the cell directly below it, type the exact same value.
For example, if your chart shows monthly sales data and you want a line at March, type "March" in one cell and "March" in the cell below. If your chart uses numbers on the X-axis and you want the line at position 5, type 5 in both cells. The two cells must be identical — Excel uses these two points to draw a vertical line between them.
You don't need a header for this column, but adding one (like "Threshold" or "Deadline") makes it easier to remember what the line represents when you return to the spreadsheet later.
Add the helper column data to your chart
Click on your chart to select it. Right-click the chart and choose Edit Data (in Excel Online) or Select Data (in desktop Excel). A dialog box opens showing your current data ranges.
In desktop Excel, click the Add button under "Legend Entries (Series)". A dialog appears asking for the series name and values. For the series name, type something like "Threshold" or "Target Date". For the series values, select the two cells in your helper column — the ones with your matching values.
In Excel Online, click Edit Data and then Edit Data in Excel. The spreadsheet opens in the full Excel editor, where you can follow the desktop steps above. Once you've added the series, click outside the dialog to close it and return to your chart.
Format the new series as a line with no markers
Your chart now shows the new data series, but it probably appears as dots or bars instead of a vertical line. Right-click on one of the new data points (the dots or bars you just added) and choose Change Series Chart Type. A dialog opens showing different chart types.
Select Line from the list on the left, then choose the line style without markers — it's usually the first option, showing a plain line with no dots. Click OK. Your vertical line now appears on the chart, though it may be thin or hard to see depending on your chart's colors.
If the line doesn't appear vertical, check that your helper column values are truly identical. If one says "March" and the other says "march" (different capitalization), Excel may treat them as different points. Fix the spelling and the line should snap into place.
Adjust the line color, thickness, and style
Right-click the line itself and choose Format Data Series. A panel opens on the right side of the screen (in newer Excel) or a dialog box appears (in older versions). Look for the Line section and click it to expand your options.
Change the Color to whatever stands out against your chart background — red, black, or a contrasting shade. Increase the Width to make the line thicker and more visible; try 2 to 3 points as a starting point. You can also change the line style to dashed or dotted if you want the line to be less prominent.
If you want to add a label to explain what the line represents, right-click the line again and choose Add Data Labels. The label appears at the top of the line and shows the value from your helper column. You can edit this label by right-clicking it and choosing Format Data Label.
Move or remove the vertical line
To move the line to a different point, simply edit the values in your helper column. Change both cells to your new target value — the line moves immediately. If your chart uses dates, make sure you type the date in the same format as your other data (for example, if your chart shows dates as "1/15/2024", type that format in your helper column).
To remove the line, right-click it and choose Delete. The line disappears, but your helper column remains in the spreadsheet. You can delete the helper column itself if you no longer need it, or leave it in place in case you want to add the line back later.
If you want to add multiple vertical lines, create additional helper columns with different values and repeat the process for each one. Each line can have its own color, thickness, and label.
Troubleshooting common problems
If your line appears horizontal instead of vertical, you've likely added the helper data to the wrong axis. Check that your helper column values match the scale of your chart's horizontal (X) axis, not the vertical (Y) axis. For example, if your chart shows months across the bottom, your helper values should be month names or numbers, not sales figures.
If the line doesn't appear at all, make sure both cells in your helper column contain exactly the same value — no extra spaces, different capitalization, or formatting differences. Also check that the chart type is set to Line, not Column or Bar, because those chart types may not display the line correctly.
If the line appears but looks like a dot or a very short segment, the two values in your helper column may be slightly different. Click on each cell and verify the contents match precisely. You can also try widening the line thickness to make it more visible while you troubleshoot.
Frequently Asked Questions
Can I add a vertical line to a chart that already has multiple data series?
Yes. The helper column method works with any chart that has a horizontal axis. Just make sure your helper values use the same scale as your existing X-axis data — if your chart shows dates, use dates; if it shows numbers, use numbers. The new line series will layer on top of your existing data.
What if my chart uses dates on the X-axis and I'm not sure what format to use?
Look at how the dates appear in your chart's axis labels. If they show as "Jan", "Feb", "Mar", type those month abbreviations in your helper column. If they show as "1/1/2024", use that format. You can also click on a date cell in your original data and copy its format to your helper column to ensure they match.
Can I make the vertical line dashed or dotted instead of solid?
Yes. Right-click the line, choose Format Data Series, find the Line section, and look for Dash Type or Line Style. Select dashed, dotted, or dash-dot from the menu. This is useful when you want the line to be less visually dominant than a solid line.
What happens if I copy or share the spreadsheet with someone else?
The vertical line stays in place because it's part of your chart data. The helper column remains visible in the spreadsheet, so the other person can see how the line was created and can move it by editing the helper values if needed. If you want to hide the helper column, right-click it and choose Hide.
Can I add a vertical line to a pie chart or donut chart?
No. Vertical lines only work on charts with a horizontal axis — column charts, line charts, bar charts, and combination charts. Pie and donut charts don't have axes, so this method won't work for those chart types.