# How to Add a Vertical Line to a Scatter Plot in Excel – 2 Methods

This is the sample dataset.

## Method 1 – Using Error Bars to Add a Vertical Line to a Scatter Plot in Excel

Steps

• Select B5:C11.

• Go to the Insert tab.
• In Charts, select Scatter Chart.

• Select the Scatter chart shown below:

The following chart is displayed:

• To modify the chart, click the plus sign (Chart Elements).
• Add Axes and Axis Title to the chart:

You can modify the Chart Style by clicking the Brush sign.

This is the output.

• Right-click the chart.
• Click Select Data.

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

• In the Edit Series dialog box, set the Series name, Series X values, and Series Y values.
• Click OK.

• In the Select Data Source dialog box, click OK.

The point of the student whose roll number is 4 has a different color:

• Click that point.

• In Chart Design, select Chart Layouts.
• Choose Add Chart Element .

• Select Error Bars.
• Select Percentage.

Horizontal and vertical percentage lines will be created on the point.

• In Error Amount, set the Percentage to 0.

The horizontal line is removed:

• Right-click the vertical line on the point.
• Select Format Error Bars.

• In the Format Error Bars dialog box, in Vertical Error Bar, set the direction as Both (the error bar will show in both directions).
• In Error Amount, set the Percentage to 100.

This is the output.

You can change the color and width of the vertical line in Format Error Bars:

• Go to Fill & Line.
• In Line, change the Color and Width.

This is the final output.

## Method 2 – Adding a Vertical Line to a Scatter Plot Using Excel Shapes

Steps

• Select B5:C11.

• Go to the Insert tab.
• In Charts, select Scatter Chart.

• Select the first Scatter chart.

The following chart is displayed:

• To modify the chart, click the plus sign (Chart Elements).
• Add Axes and Axis Title.

You can modify the Chart Style clicking the Brush sign.

This is the output.

• Go to the Insert tab and select Illustrations.

• Select Shapes.

• Choose the first Line in Lines.

• The mouse cursor will change. Click a point to add the vertical line.
• To keep the line straight, press Shift.

The line will be displayed in the chart.

• Click the line.
• In Shape Format, select Shape Styles.

• In Theme Styles, select a theme.

The vertical line is displayed:

## Related Articles

<< Go Back To Edit Scatter Chart in ExcelScatter Chart in Excel | Excel ChartsLearn Excel

Get FREE Advanced Excel Exercises with Solutions!
Durjoy Paul

Durjoy Kumar, with a BSc in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, is a dedicated contributor to the ExcelDemy project. His substantial contributions include crafting numerous articles and demonstrating expertise in Excel and VBA. Durjoy adeptly automates Excel challenges using VBA macros, offering valuable solutions for user interface challenges. Apart from creating Excel tutorials, he is interested in Data Analysis with MS Excel, SPSS, C, C++, C#, JavaScript, Python Web Scraping, Data Entry... Read Full Bio

We will be happy to hear your thoughts

Advanced Excel Exercises with Solutions PDF