How to add a vertical line to the chart

Excel 2016 2013 2010 2007
This tip is about how to add a vertical line in your chart. E.g., this will be useful to show data and highlight a current date.
Chart with vertical line in Excel 365

To add a vertical line to your line or scatter chart, do the following:

   1.   Add the date with the current date to your data, for example:

Data in Excel 365

   2.   To add a new data series to your chart, do one of the following:

  • On the Chart Design tab, in the Data group, choose Select Data:
    Select Data in Excel 365
  • Right-click in the chart area and choose Select Data... in the popup menu:
    Select Data in popup menu Excel 365

In the Select Data Source dialog box, click the Add button and in the Edit Series dialog box, type:

  • In the Series values box - the cell with the current date ($C$2):
New Data Series in Excel 365

   3.   If it is necessary, change data series:

  • Right-click in the new data series and choose Change Series Chart Type... in the popup menu:
    Change Series Chart Type in Excel 365
  • In the Change Chart Type dialog box, choose the Scatter type:
    Change Series Chart Type in Excel 365

In the Select Data Source dialog box, click the Edit button, and in the Edit Series dialog box, type:

  • In the Series X values box - the cell with the current date ($C$2)
  • In the Series Y values box - constant value (1):
New Data Series in Excel 365

   4.   Select the new data series, then do one of the following:

  • Click on the Chart Elements button, select the Error Bars list, then choose More Options...:
    Chart Elements - Error Bars in Excel 365
  • On the Chart Design tab, in the Chart Layouts group, click the Add Chart Element drop-down list:
    Add Chart Element button in Excel 365

    In the Add Chart Element drop-down list, choose the Error Bars list, then click More Error Bars Options...:

    More Error Bars Options in Excel 365

Excel propose several error bars, also you can use More Error Bars Options.... If necessary, you can fine-tune the error bar settings from the Format Error Bars pane:

Format Error Bars Options in Excel 365

If you change the date, the chart will be changed too:

Chart with vertical line in Excel 365

You can then make any other adjustments to get the expected look.

See also this tip in French: Comment ajouter une ligne verticale au graphique.

If you have any questions or suggestions, please feel free to ask OfficeToolTips team.

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information you’ve provided to them or they’ve collected from your use of their services.

Learn more