How to Add Data Labels to a Scatter Plot in Excel (2 Methods)

Dataset Overview

Suppose we have a Weight List of 10 individuals. We want to plot the Weight according to the Name of the individual in a Scatter Plot. Also, we want to add data labels to the chart to make it more understandable.

add data labels to scatter plot excel


Method 1 – Using the Chart Elements Options 

  • Create the Scatter Plot:
    • First, select the cells in the B4:C14 range. These columns represent the Name and Weight (lbs) of the individuals.
    • Go to the Insert tab and choose Insert Scatter (X, Y) or Bubble Chart > Scatter.

add data labels to scatter plot excel using chart elements option

    • The scatter plot will now visualize our data table.

add data labels to scatter plot excel using chart elements option

  • Add Data Labels:
    • Next, switch to the Chart Design tab.
    • Click Add Chart Element in the ribbon and select Data Labels from the drop-down list.
    • Click More Data Label Options to open the Format Data Labels task pane.

add data labels to scatter plot excel using chart elements option

  • In the Label Options, check the box for Value From Cells.
  • Select the cells in the B5:B14 range (containing individual names) as the data label range.
  • Click OK.

add data labels to scatter plot excel using chart elements option

  • Uncheck the box for Y Value in the Label Options.

add data labels to scatter plot excel using chart elements option

  • Our Scatter Plot with data labels looks like the one below.

add data labels to scatter plot excel using chart elements option

  • Fine-Tune Data Labels:
    • To address partially unified labels, double-click the data label for James.

add data labels to scatter plot excel using chart elements option

    • In the Format Data Label task pane, set the Label Position to Above.

add data labels to scatter plot excel using chart elements option

    • For better visibility, select the James label again and go to Effects.

add data labels to scatter plot excel using chart elements option

  • Under the Shadow category, choose a shadow style.

add data labels to scatter plot excel using chart elements option

  • Now your scatter plot with clear data labels is ready.

add data labels to scatter plot excel using chart elements option

  • With the data range, our Scatter Plot with data labels looks like the one below.

add data labels to scatter plot excel using chart elements option


Method 2 – Applying Excel VBA Code

Open the Visual Basic for Applications (VBA) Window:

  • Right-click on the sheet name (VBA).
  • Select View Code from the options.

add data labels to scatter plot excel applying VBA code

  • The Microsoft Visual Basic for Applications window will open.

Insert a Code Module:

  • Go to the Insert tab and select Module.

add data labels to scatter plot excel applying VBA code

  • This opens a code module where you can paste the following VBA code:
Sub AddDataLabels()
If Left(TypeName(Selection), 5) <> "Chart" Then
MsgBox "Please select the scatter plot first."
Exit Sub
End If
Set StartLabel = _
Application.InputBox("Click on the cell containing the first label", Type:=8)
Application.ScreenUpdating = False
For Each pt In ActiveChart.SeriesCollection(1).Points
pt.ApplyDataLabels xlDataLabelsShowValue
pt.DataLabel.Caption = StartLabel.Value
Set StartLabel = StartLabel.Offset(1)
Next
End Sub

add data labels to scatter plot excel applying VBA code


Explanation of VBA Code:

  • The AddDataLabels macro checks if a scatter plot is selected. If not, it displays a message.
  • An input box prompts you to select the cell containing the first label.
  • The code applies data labels to each point in the scatter plot, using the values from the specified range.

  • Save the workbook in Macro-Enabled format.

add data labels to scatter plot excel applying VBA code

 

Run the Macro:

  • Go to the Developer tab.
  • Select Macros from the ribbon.

 

Applying VBA Code

  • Choose the AddDataLabels macro and click Run.

Applying VBA Code

  • If you encounter an error (e.g., Please select the scatter plot first), ensure you’ve selected the chart before running the macro.

Applying VBA Code

  • Specify cell B5 as the reference for the first label.
  • Click OK.

Applying VBA Code

Scatter Plot with Data Labels:

  • Your scatter plot should now display data labels.

Applying VBA Code


How to Remove Data Labels in Excel

In case you need to remove data labels:

Method 1 – Using Add Chart Element

  • Go to the Chart Elements sheet.
  • Select the scatter plot.
  • Navigate to the Chart Design tab.
  • Choose Add Chart Element > Data Labels > None.

Removing Data Labels using chart elements

Removing Data Labels using chart elements


Method 2 – Pressing the Delete Key

  • Click once to select all data labels in a data series.
  • Double-click to select a specific label.
  • Press the DELETE key to remove data labels.

Method 3 – Using the Delete Option

  • Go to the Chart Elements sheet.
  • Right-click on any data label.
  • Select Delete.

Removing Data Labels using Delete option

Read More: How to Add Line to Scatter Plot in Excel


Download Practice Workbook

You can download the practice workbook from here:


 

Related Articles


<< Go Back To Edit Scatter Chart in Excel | Scatter Chart in Excel | Excel Charts | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Shahriar Abrar Rafid
Shahriar Abrar Rafid

Shahriar Abrar Rafid, BSc, Naval Architecture and Marine Engineering, Bangladesh University of Engineering and Technology, Bangladesh, has worked with the ExcelDemy project for more than 1 year. He has written over 100+ articles for ExcelDemy. He is a professional visual content developer adept at crafting scripts, meticulously editing Excel files, and delivering insightful video tutorials for YouTube channels. His work and learning interests vary from Microsoft Office Suites and Excel to Data Analysis, VBA, and Video recording and... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo