7 Ways To Edit Axis Labels in Microsoft Excel

This elaborate Microsoft Excel tutorial will help you learn how to edit axis labels in Excel with complete mastery.

Ever look at a graph and have no idea what it’s trying to show? That’s because charts without labels on the axes (the X and Y lines) are confusing. Even worse, charts with wrong labels can be misleading!

This can make people question your data or your understanding of the information. Plus, if your chart doesn’t turn out how you pictured it, that can be frustrating.

The good news is, there’s an easy fix! Learning how to edit horizontal and vertical axis labels in Excel is a key skill for making clear and informative charts. This lets you tell a story with your data, not just show a bunch of numbers.

Don’t worry, you won’t need all day! Even if you’ve never edited axis labels before, this guide will walk you through everything you need to know in under an hour. By the end, you’ll be a chart-labeling pro!

📒 Read More: 7 Ways to Add Chart Axis Labels in Microsoft Excel

Using the Format Axis Tool

Format Axis
Format Axis

The Format Axis pane contains all visual and technical parameters for your chart’s Y and X axes. It’s located on the right-side border of the Excel app when activated.

You can do the following edits on axis labels:

  • For the vertical axis label, you can adjust the values by customizing the Bounds and Units options. By default, Excel would automatically choose the mathematically appropriate bounds by analyzing the input values for the Series axis.
  • You can manually change the default values of the Category or horizontal axis label. I’ll describe that later in this tutorial. Also, you can use the Format Axis tool’s Axis Options sub-tool to customize various technical aspects of the Category axis label.

Let me show you a few Y-axis label edits that are mandatory to make the default chart more attractive and meaningful.

Sample dataset 1

For example, when you use the dataset in A1:B12 to insert a single series line chart, you get the chart shown in the screenshot.

In the above chart, the values for the bounds aren’t optimized. Hence, the data labels and the trend line are at the top of the chart. It has more empty space than visual information. Here, you can edit the Y-axis label parameters to make the graph more acceptable.

Enable Format Axis pane
Enable Format Axis pane

Firstly, double-click on the values in the vertical axis label to bring up the Format Axis panel.

The tool should automatically select the Axis Options menu for technical customizations.

There, you can make the following edits:

Bounds

Editing Bounds to resize the Y-axis level
Editing Bounds to resize the Y-axis level

Since all cartesian charts start from 0, you can keep the Minimum value in the default range. However, change the Maximum value higher to the top value in your dataset so the trendline comes closer to the midpoint. You can try 2.5 points for the example dataset shown above.

Units

Editing Units for axis label
Editing Units for axis label

The default axis label is cluttered with many unit values. You can declutter it by increasing the value in the Major field. Try 0.5, which gives an adequate view of the data labels in less space.

Display units

Display unit changes decimal points
Display unit changes decimal points

Click on the drop-down menu to choose various levels of decimal points for the values used in the axis label. For example, if you choose Hundreds, 2.5 will be expressed as 0.025. As you change this value, watch out for the trend line data labels as well because those will also start showing decimal points. Consequently, the trendline will also look cluttered.

Tick Marks

Editing tick marks
Editing tick marks

By default, the axis label won’t show any tick marks. You’ll need to add Major and Minor tick marks manually by clicking the respective drop-down menus. You can choose from three tick mark positions. These are Inside, Outside, and Cross.

Axis Options for Category labels
Axis Options for Category labels

The Axis Options features for the Category axis are a bit different. If you need to edit the technical parameters of this axis label, double-click on it to get the Format Axis pane.

Click on the Axis Options icon. It looks like a column chart. It’s the fourth menu in the pane.

Editing Axis Options for horizontal label
Editing Axis Options for horizontal label

Expand the Axis Options menu by clicking on it. It’ll show the following customizations:

  • Axist type: Automatic, Text, and Date
  • Vertical axis crosses: Automatic, At a custom category number, like 2, and At maximum category
  • Axis position: On tick marks or Between tick marks
Editing tick marks type of axis labels
Editing tick marks type of axis labels

If you need Tick Marks on the horizontal axis label, you can expand the Tick Marks menu on Format Axis and choose appropriate values for the following items:

  • Interval between marks: Should be any number but not more than the total Category points in the chart
  • Major and Minor type: Choose from Inside, Outside, and Cross

📒 Read More: 5 Ways to Switch the X and Y Axis in Microsoft Excel

Using the Category Values in the Worksheet

Detailed illustration of Category and Series values
Detailed illustration of Category and Series values

By default, Excel uses the values or texts from the input dataset of a chart to create the horizontal axis label.

So, you can edit the contents of the input dataset to edit the Category axis label.

Right click to Select Data
Right-click to Select Data

To locate the column for the Category axis values, click on the chart and right-click.

From the context menu that opens, choose Select Data.

Revealing the column for Category axis values
Revealing the column for Category axis values

The Select Data Source will open. The values or texts on the right side of the dialog box create the Category axis label.

By looking at that, you can identify which column contributes to the Category axis label.

Edited Category axis label
Edited Category axis label

You can now directly edit the contents of the column with new values or texts.

The Category axis label will update dynamically.

Using the Axis Labels Edit Tool

Often, you might want to display a Category axis label in the chart that’s different from the input data. Here, the Axis Labels editing tool comes in handy.

This tool allows you to remove the default label and type in any custom value or text as you require.

Sample dataset 2

For example, in the above dataset, months have been expressed in 1, 2, 3, 4, 5, and 6 instead of Jan, Feb, Mar, Apr, May, and Jun.

So, when you create a line chart using this data, the X-axis (Category) labels show 1, 2, 3

However, it would make more sense if you use Jan, Feb, Mar

Select Data Source
Select Data Source

To display calendar months instead of the numerical denominators of months, go to the Select Data Source dialog box by right-clicking on the chart.

Click on the Edit button below the Horizontal Axis Labels list.

Axis Labels dialog box
Axis Labels dialog box

The Axis Labels dialog box will open.

Editing Axis Labels
Editing Axis Labels

Into the Axis Labels field, type in the custom Category axis label values as shown below:

Jan,Feb,Mar,Apr,May,Jun

Click OK to apply the changes.

Custom Category labels
Custom Category labels

You should see the custom Category label values have already shown up below the Horizontal Axis Labels list.

Edited Category axis labels
Edited Category axis labels

Click OK to include the new labels in the chart.

Editing Label Position for All Axes

Both the Y and X-axis labels for a chart, by default, show up to the left and at the bottom respectively. However, if you wish to display it in different positions, you can use the Labels sub-menu of the Axis Options in the Format Axis tool.

example chart 1

In the line chart shown above, the axis labels are in the default position.

Suppose, you wish to reposition the label near the higher or lower values of the chart.

Axis Options Labels menu
Axis Options Labels menu

Open the Format Axis tool by double-clicking on the Y-axis (Series) label.

Click on the Axis Options menu icon and expand the Labels menu.

Series axis label position High
Series axis label position High

You’ll see the Next to Axis drop-down menu. Click on that to choose other options, like High, Low, or None.

Axis labels near the higher value
Axis labels near the higher value

If you select High, Excel will shift the Series axis label on the top of the chart.

Changing position of Category label
Changing position of Category label

To change the label position for the Category axis, simply click on the X-axis.

The Format Axis tool will automatically navigate to the Labels menu for the Category axis label.

Now, you can change its position on the chart by clicking the Next to Axis drop-down.

Editing the Number Format

Usually, Excel matches the number formatting of the Series axis labels to that of the input dataset.

However, if that doesn’t happen for any reason, you can manually fix it from the Number menu of the Format Axis tool.

Mismatch in number formatting
Mismatch in number formatting

For example, in the above chart, the number formatting for the data labels of the trend line is in the Currency format. However, the Series axis labels don’t reflect that.

Expand the Number menu
Expand the Number menu

To fix this, click on the Y-axis labels. Axis Options should open automatically in the Format Axis pane. If not, navigate to Axis Options.

Click the Number menu arrow to expand its options.

Edited number formatting in axis label
Edited number formatting in the axis label

Click the General drop-down menu to see all number formatting options.

Select the Currency option from the context menu. The Y-axis labels should reflect the number formatting you’ve just selected.

Editing number formatting for Category axis label
Editing number formatting for Category axis label

You can follow the same steps to customize the number formatting for the Category axis labels.

Editing Style of Axis Label Data Points

Do you want to give the axis labels a more stylish look than the default one? You can use the Shape Styles and WordArt Styles in the Format tab.

The Format tab
The Format tab

The Format tab isn’t visible by default. You must click on the chart object or any of the axis labels to see this tab.

Shape Effects
Shape Effects

Suppose, you want to customize the shapes of the axis label points so they become prominent. Click on the Shape Effects drop-down menu and choose the Offset: Bottom option from the Shadow menu.

Shape Fill
Shape Fill

Now, click on the Shape Fill drop-down and choose a color from the context menu.

Quick Styles arrow
Quick Styles arrow

If you wish to customize the font of the axis labels, click the Quick Styles arrow in the WordArt Styles commands block.

WordArt styles
WordArt styles

You can now choose a style from the Quick Styles context menu.

Using Excel VBA

You can edit the Y and X-axis labels in Excel automatically with interactive inputs using Excel VBA.

You only need to implement the VBA scripts mentioned here into VBA macros. To learn the technique first, follow along with this Excel tutorial:

📒 Read More: How To Use The VBA Code You Find Online

Edit Series Axis Labels

Use this VBA script to edit various technical elements of the Y-axis labels with visual prompts:

VBA script 1
Sub EditAxisLabels()
    Dim ws As Worksheet
    Dim cht As Chart
    Dim sourceChart As String
    Dim minBound As Double
    Dim maxBound As Double
    Dim majorUnit As Double
    Dim minorUnit As Double
    Dim useLogarithmicScale As Boolean
    Dim showLabelsNextToAxis As Boolean
    
    ' Get the active worksheet
    Set ws = ActiveSheet
    
    ' Prompt for source chart
    sourceChart = InputBox("Enter the source chart name:")
    
    ' Prompt for bounds
    minBound = InputBox("Enter the minimum bound:")
    maxBound = InputBox("Enter the maximum bound:")
    
    ' Prompt for major and minor units
    majorUnit = InputBox("Enter the major unit:")
    minorUnit = InputBox("Enter the minor unit:")
    
    ' Confirm logarithmic scale
    useLogarithmicScale = MsgBox("Use logarithmic scale?", vbYesNo) = vbYes
    
    ' Confirm labels position
    showLabelsNextToAxis = MsgBox("Show labels next to axis?", vbYesNo) = vbYes
    
    ' Assuming you have an existing chart named "MyChart" on the active sheet
    On Error Resume Next
    Set cht = ws.ChartObjects(sourceChart).Chart
    On Error GoTo 0
    
    If Not cht Is Nothing Then
        With cht
            ' Set axis properties
            .Axes(xlValue).MinimumScale = minBound
            .Axes(xlValue).MaximumScale = maxBound
            .Axes(xlValue).majorUnit = majorUnit
            .Axes(xlValue).minorUnit = minorUnit
            .Axes(xlValue).Logarithmic = useLogarithmicScale
            .Axes(xlValue).TickLabelPosition = IIf(showLabelsNextToAxis, xlTickLabelPositionNextToAxis, xlTickLabelPositionHigh)
        End With
        MsgBox "Axis labels updated successfully!", vbInformation
    Else
        MsgBox "Chart not found. Make sure the chart name is correct.", vbExclamation
    End If
End Sub

Upon running the script, you’ll get the following prompts. Interact with the prompts appropriately to edit the Series axis labels:

Chart name
Chart name
  • Enter source chart name: For example Chart 1, Chart 2, etc. You can click on the target chart on the worksheet to find its name in the Name Box.
Maximum bound
Maximum bound
  • Select maximum bound
Major unit
Major unit
  • Choose the major unit
Choose label position
Choose label position
  • Select whether you want labels next to the axis or not
Edited axis labels using VBA
Edited axis labels using VBA

Excel customizes the Y-axis according to your inputs.

Edit Category Axis Labels

You can use this script to edit the X-axis labels using a custom input:

VBA script 2
Sub UpdateCategoryAxisLabels()
    Dim ws As Worksheet
    Dim cht As Chart
    Dim chartName As String
    Dim customLabels As String
    Dim labelArray() As String
    Dim i As Long
    
    ' Prompt for chart name
    chartName = InputBox("Enter the chart name (e.g., Chart 1):")
    
    ' Prompt for custom category axis labels
    customLabels = InputBox("Enter custom category axis labels (comma-separated):")
    labelArray = Split(customLabels, ",")
    
    ' Find the chart on the active sheet
    On Error Resume Next
    Set ws = ActiveSheet
    Set cht = ws.ChartObjects(chartName).Chart
    On Error GoTo 0
    
    If Not cht Is Nothing Then
        ' Update category axis labels
        With cht.Axes(xlCategory, xlPrimary)
            .CategoryType = xlCategoryScale
            .CategoryNames = labelArray
        End With
        MsgBox "Category axis labels updated successfully!", vbInformation
    Else
        MsgBox "Chart not found. Please check the chart name.", vbExclamation
    End If
End Sub

As you run the script, Excel will show an input box so you can enter the source chart name.

Custom Category labels
Custom Category labels

There will be another prompt where you can enter the text string or numerical values for the X-axis labels.

Edited Category labels using VBA
Edited Category labels using VBA

Excel will instantly modify the target axis labels.

Conclusions

If you’re here, congratulations! You’ve learned how to edit axis labels in Excel using various manual and automated methods.

If you liked this Excel tutorial, comment below to share your acknowledgment. Know a better technique for editing X or Y-axis labels in Excel? Share your tips or suggestions in the comment box.

About the Author

Bipasha Nath

Bipasha Nath

Bipasha is a technical content writer with 10+ years of experience in the technology industry. She previously worked in a SaaS software development company focused on SharePoint, OneDrive, Word, Excel, Word solutions.

Related Posts

Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get the Latest Microsoft Excel Tips

Follow Us

Follow us to stay up to date with the latest in Microsoft Excel!

Subscribe for awesome Microsoft Excel videos 😃