How to Change Horizontal Axis Values in Excel
In this article
To change the horizontal axis values in Excel, right-click your chart, select Select Data, click Edit under the Horizontal (Category) Axis Labels section, and select the new range of cells containing your labels. This process allows you to replace generic numbers (like 1, 2, 3) with actual dates, names, or categories, ensuring your data is readable and professional.
What You'll Need
- A computer with Microsoft Excel installed.
- An existing chart (Column, Bar, Line, or Area) that requires axis updates.
- A prepared range of cells in your spreadsheet containing the correct labels you wish to appear on the axis.
Step-by-Step
- Identify the Target Data: Before opening the chart settings, ensure the new labels you want to use are typed into a contiguous range of cells. For example, if you have sales data for January through June, make sure those month names are listed in a single column or row next to your numerical data.
- Access the Select Data Source Menu: Right-click anywhere on the blank area of your chart or directly on the horizontal axis labels. From the context menu that appears, select Select Data.... Note that menu labels may differ slightly depending on your version of Excel or operating system.
- Locate the Horizontal Axis Labels Section: A dialog box titled "Select Data Source" will open. You will see two main sections: "Legend Entries (Series)" on the left and "Horizontal (Category) Axis Labels" on the right. Focus on the right-hand side.
- Enter the Edit Mode: Click the Edit button located under the Horizontal (Category) Axis Labels section. This will open a smaller dialog box called "Axis Labels."
- Define the New Range: In the "Axis label range" box, you can either type the cell references manually (e.g., =Sheet1!$A$2:$A$7) or, more simply, click the collapse button (the small arrow/grid icon) and use your mouse to highlight the range of cells on your worksheet that contains the desired labels.
- Confirm the Selection: Once the correct range is highlighted and appears in the box, click OK to close the Axis Labels dialog box.
- Finalize the Chart Update: Click OK again on the main Select Data Source window. Your chart will now automatically update, replacing the old values or default numbers with the custom text or dates you selected.
Common Mistakes
One of the most frequent errors occurs when the number of labels selected does not match the number of data points in the series. If you have twelve months of data but only select six labels for the axis, Excel will either leave the remaining slots blank or fill them with default numbering, leading to a confusing visual representation. Always double-check that your label range is the same length as your data range.
Another common mistake is selecting the header of the column (e.g., selecting the cell that says "Month" along with the actual months). This results in the word "Month" appearing as the first label on your axis, which is usually unnecessary and looks unprofessional. Ensure you only select the actual data values, not the column titles.
Users also frequently confuse the "Legend Entries" (the left side of the Select Data window) with the "Horizontal Axis Labels" (the right side). Changing the Legend Entries changes the names of the data series (the lines or bars themselves), whereas changing the Horizontal Axis Labels changes the categories listed along the bottom of the chart.
Tips
To keep your chart dynamic, consider using Excel Tables. If you convert your data range into a Table (Ctrl + T), and then base your chart on that table, the horizontal axis will often update automatically when you add new rows to the bottom of the table. This eliminates the need to manually go back into the Select Data menu every time you add a new month or category.
If your horizontal axis labels are too long and are overlapping or appearing diagonally, you can change their orientation. Right-click the axis, select Format Axis, go to the Size & Properties icon (the square with arrows), and adjust the Text direction or Custom angle. This ensures that long category names remain legible without cluttering the chart.
For those working with dates, Excel usually recognizes date formats automatically. However, if your dates are appearing as numbers (e.g., 45123 instead of 2023-06-01), you can fix this by right-clicking the axis, selecting Format Axis, and navigating to the Number category at the bottom of the pane. Change the Category from "General" to "Date" and pick your preferred format.
Troubleshooting
The Edit button is greyed out: This typically happens if the chart type does not support category labels in the traditional sense, such as an XY Scatter Plot. In a Scatter Plot, both the X and Y axes are value axes. To change the X-axis values in a Scatter Plot, you must edit the Series on the left side of the Select Data window. Click Edit on the series, and you will see a specific box for "Series X values." Select your range there instead of using the Horizontal Axis Labels section.
Labels are not updating despite selecting the range: Check if your worksheet is protected. If the sheet is locked, some chart elements may not refresh correctly. Unprotect the sheet via the Review tab and try the process again. Additionally, ensure that the cells you are selecting are not merged. Merged cells can confuse Excel's range selection tool, often leading to only the first cell of the merged group being recognized.
The axis is showing numbers (1, 2, 3) instead of my text: This usually means the "Axis Label Range" box in the Select Data window is empty. Even if you think you selected the data when creating the chart, Excel sometimes defaults to numbering if the initial selection was ambiguous. Follow the step-by-step guide above to manually re-assign the range.
Frequently Asked Questions
Can I use a different sheet for my axis labels?
Yes. When the "Axis Labels" dialog box is open, you can click on any other tab/sheet in your workbook and select the range there. Excel will automatically include the sheet name in the reference (e.g., =Sheet2!$A$1:$A$10).
How do I remove the horizontal axis labels entirely?
The fastest way is to click on the axis labels in the chart to select them and press the Delete key on your keyboard. Alternatively, go to the Chart Design tab, click Add Chart Element > Axes, and uncheck Primary Horizontal.
Can I change the labels to a custom list not found in my cells?
Excel requires axis labels to be linked to a range of cells. If you want custom labels that aren't part of your main data set, you must type those labels into a hidden column or a separate area of your spreadsheet and then link the axis to that range using the Select Data method.
Why are my dates showing as numbers like 44561?
Excel stores dates as sequential serial numbers. If the axis format is set to "General," you see the serial number. To fix this, right-click the axis, select Format Axis, and change the Number format to "Date" in the formatting pane.
Does this work for 3D charts?
Yes, the process for changing horizontal axis labels is identical for 2D and 3D charts. However, be mindful that in 3D charts, you may also have a "Depth' axis, which is managed in the same Select Data window but is distinct from the horizontal category axis.