What you're changing when you edit the x-axis
The x-axis is the horizontal line at the bottom of an Excel chart. The values or labels on it come from a column or row in your spreadsheet — usually the leftmost column or the top row of your data. When you change the x-axis, you're telling Excel to use different data for those labels, or to display the existing data in a different way.
Most of the time, you'll want to change the x-axis because the labels are wrong, too crowded, or pointing to the wrong column. Excel sometimes picks the wrong data source on its own, especially if your spreadsheet layout is unusual. The fix is usually quick — you select the chart, open one menu, and point Excel to the right data.
Key Takeaways
- Right-click the x-axis itself (the horizontal line with the labels) and select "Format Axis" to change how the labels look, their angle, or their spacing.
- To change which data appears on the x-axis, right-click the chart, select "Select Data", and use the "Horizontal (Category) Axis Labels" field to point to a different range.
- If your x-axis shows numbers instead of names or dates, you likely need to change the data range in the Select Data dialog, not the axis format.
- Rotating x-axis labels 45 degrees often fixes crowding when you have many labels — right-click the axis, go to "Format Axis", and change the "Alignment" angle.
Change which data appears on the x-axis using Select Data
This is the most common fix. If your chart is pulling x-axis labels from the wrong column, or if you want to swap in a different set of labels entirely, you use the Select Data dialog.
First, click anywhere on the chart to select it. You'll see a border around the chart and the chart tools appear in the ribbon at the top. Now right-click the chart itself (not the axis) and choose "Select Data" from the menu. A dialog box opens.
In the Select Data dialog, look for the section called "Horizontal (Category) Axis Labels" on the left side. Click the button next to the text field — it looks like a small grid icon. Now click and drag to select the cells in your spreadsheet that should be the x-axis labels. These are usually in a single row or column. When you've selected them, press Enter or click the grid icon again to confirm. Click OK to close the dialog and your chart updates.
If you're not sure which cells to select, look at your spreadsheet and find the row or column that contains the labels you want on the x-axis. For example, if you have months in column A (January, February, March), select those cells. If you have product names across the top row, select that row.
Rotate or reposition x-axis labels to reduce crowding
When you have many labels on the x-axis, they often overlap and become unreadable. The quickest fix is to rotate them so they stand at an angle instead of lying flat.
Right-click directly on the x-axis — the horizontal line itself, not the chart background. A menu appears. Click "Format Axis". A panel opens on the right side of your screen (in newer Excel versions) or a dialog box appears (in older versions).
Look for the "Alignment" section. You'll see a field labeled "Text direction" or "Angle". Change the angle to 45 degrees — this tilts the labels so they lean up and to the right, which usually gives them enough room. If 45 degrees still isn't enough, try 90 degrees to make them vertical. Click outside the panel or click OK to apply the change.
If rotating doesn't help because you have too many labels, you can also reduce the number of labels Excel shows. In the same Format Axis panel, look for "Interval between labels" or "Specify interval unit". Change this to 2 or 3 to show every second or third label instead of every one. This thins out the crowding without rotating.
Change the number format or spacing of x-axis values
If your x-axis shows numbers (like 1, 2, 3 or 100, 200, 300) and you want to change how they look, you format the axis itself rather than changing the data.
Right-click the x-axis and select "Format Axis". In the panel that opens, look for "Number" on the left side. Click it. You'll see options to change the number of decimal places, add a thousands separator (comma), or switch to a percentage or currency format. Make your changes and the axis updates immediately.
You can also control the spacing between numbers. In the Format Axis panel, find "Axis Options" and look for "Major unit" or "Minimum/Maximum". The major unit controls how far apart the numbers are — a larger number spreads them out more. If your axis shows 0, 10, 20, 30 and you want 0, 25, 50, 75, change the major unit from 10 to 25.
Swap rows and columns if the x-axis is using the wrong data
Sometimes Excel builds your chart with the data transposed — what should be on the x-axis ended up on the y-axis, and vice versa. This happens when your spreadsheet layout doesn't match what Excel expects.
Right-click the chart and select "Select Data". In the dialog, look for a button labeled "Switch Row/Column" — it's usually near the bottom left. Click it once. The chart flips: what was on the x-axis moves to the y-axis and the other way around. If this fixes the problem, click OK. If it makes it worse, click the button again to switch back.
Remove or hide the x-axis entirely
If you don't need the x-axis labels at all, you can hide them. Right-click the x-axis and select "Format Axis". In the panel, find "Axis Options" and look for a checkbox labeled "Show axis" or "Axis line". Uncheck it to hide the entire axis, including the line and all labels.
If you want to keep the axis line but hide only the labels, right-click the axis again, select "Format Axis", find "Labels", and change the dropdown from "Low" or "Next to axis" to "None".
Frequently Asked Questions
Why does my x-axis show numbers instead of the names I want?
Excel is using the wrong data range for the axis labels. Right-click the chart, select "Select Data", and in the "Horizontal (Category) Axis Labels" field, click the grid icon and select the cells that contain the names you want — usually a column with text like product names or months.
How do I change the x-axis to show dates instead of numbers?
First, make sure the cells in your spreadsheet actually contain dates, not just numbers that look like dates. Then right-click the x-axis, select "Format Axis", click "Number", and choose "Date" from the category list. Pick the date format you want and click OK.
Can I have different labels on the x-axis than what's in my spreadsheet?
Not directly — the x-axis labels must come from cells in your spreadsheet. If you need different labels, edit the cells themselves in the spreadsheet, or create a new column with the labels you want and point the chart to that column instead.
What if the x-axis labels are still overlapping after I rotate them?
Try rotating to 90 degrees (vertical) instead of 45 degrees. If that doesn't work, reduce the number of labels shown by using the "Interval between labels" setting in Format Axis — change it to 2 or 3 to show every second or third label.
How do I make the x-axis start at a different number?
Right-click the x-axis, select "Format Axis", find "Axis Options", and change the "Minimum" value to the number you want the axis to start at. For example, change it from 0 to 10 if you want the axis to begin at 10 instead.