To select x-axis data in Excel for Microsoft 365 on Windows, click the chart, choose Chart Design > Select Data, then edit Horizontal (Category) Axis Labels and select the worksheet cells you want. For an XY (Scatter) chart, use Edit under Legend Entries (Series) to set the series’ Series X values instead; the two chart types handle x-axis data differently.
What Excel means by x-axis data
“X-axis data” can mean the labels shown along the bottom of a chart, or the numeric x-coordinates that determine where plotted points appear. In a column or line chart, Excel generally treats the horizontal axis as a sequence of categories. It displays labels such as months, product names, or numbered positions, while the vertical axis represents the values. Those category labels can look like numbers or dates without functioning as true numeric coordinates.
An XY (Scatter) chart works differently: each point is positioned using a pair of numeric values, one for x and one for y. For example, if column A contains elapsed time and column B contains temperature, a scatter chart can place each temperature at its corresponding time value. This distinction matters because changing category labels does not set the x-coordinates of a scatter series, and changing a scatter series’ x-values is not the same as editing category-axis labels.
If you are unsure which chart you have, select it and look at the chart type through Chart Design > Change Chart Type. A basic line chart uses category positions; a scatter chart plots numeric x-values. Excel may display a continuous value axis for a scatter chart, while a category axis in a line chart spaces its labels as categories.
Change category labels in a column or line chart
For a standard column, bar, or line chart, you can point the horizontal category labels to another range without rebuilding the chart. In Excel desktop for Windows, use these steps:
- Select the chart so the chart tabs appear on the ribbon.
- Choose Chart Design > Select Data. You can also right-click the chart and choose Select Data.
- In the Select Data Source dialog, find Horizontal (Category) Axis Labels and click Edit.
- Select the worksheet cells containing the desired labels. You can select a range on the same sheet or navigate to another sheet while the dialog is open.
- Click OK to close the Axis Labels dialog, then click OK again to apply the change.
For example, suppose the chart’s values are in B2:B5 and its current labels are in A2:A5, showing Q1 through Q4. If you want the chart to show full month names from D2:D5 instead, select D2:D5 in the Axis Labels dialog. The plotted values remain tied to their existing series; only the displayed category labels change. Select the same number of label cells as there are plotted categories to avoid confusing or incomplete labeling.
You can also change the underlying chart data by editing the chart’s source range, but that may change the plotted values as well as the labels. Use the Axis Labels Edit control when your intent is specifically to change what appears along the horizontal axis.
Set x-values for an XY (Scatter) chart
In an XY chart, edit the series rather than the category-label range. Select the chart, choose Chart Design > Select Data, select the series in the Legend Entries (Series) list, and click Edit. In the Edit Series dialog, set Series X values to the cells containing the x-coordinates. Set Series Y values to the matching cells containing the y-coordinates, if those also need changing. Click OK to confirm the series and again to close the data source dialog.
For example, imagine A2:A6 contains time values of 1, 2, 3, 4, and 5 hours, while B2:B6 contains temperature measurements. To plot temperature against elapsed time, use A2:A6 as Series X values and B2:B6 as Series Y values. The first x-value pairs with the first y-value, the second with the second, and so on. Keep the ranges the same length and aligned row by row; otherwise points can be paired incorrectly or Excel may reject the range.
Scatter charts expect numeric x-values. If the x-range contains text labels such as “Monday” or “Tuesday,” Excel may not position those values as meaningful numeric coordinates. If your goal is to show named groups in order, a line or column chart may be a better fit. If the data represents dates or measured quantities with meaningful spacing, a scatter chart is often more appropriate.
Choose the right range and chart type
Before selecting cells, decide whether the horizontal axis should represent categories or a measured scale. This choice affects both the chart type and the kind of data control Excel provides.
- Use category labels for names, stages, or a sequence of groups, such as departments or product models. Column and line charts are common choices.
- Use numeric x-values when horizontal distance has meaning, such as time elapsed, distance, age, or dosage. An XY (Scatter) chart lets Excel position points according to those values.
- Use dates thoughtfully. A line chart can show dates as categories or as a date axis, depending on the chart and axis settings. A scatter chart treats valid Excel dates as numeric serial values, so spacing reflects the actual time between dates.
In Select Data, Switch Row/Column changes how Excel interprets rows and columns as series. It is useful when Excel has treated each row as a separate series but you intended each column to be one. It does not directly choose a different x-axis range; after switching, inspect the series and axis labels to confirm they match your intended layout.
For a bar chart, the category labels are usually displayed vertically along the chart’s vertical side because the bars run horizontally. The Select Data Source dialog still calls the category-label control Horizontal (Category) Axis Labels in many chart contexts. Think of this as the category-label range, rather than relying on the visual direction of the axis.
Common problems and how to fix them
If the x-axis still shows the old labels, reopen Select Data and check that you edited the axis-label range rather than a series. Confirm that you selected the intended cells and applied both dialog boxes. If a chart is filtered, also check the chart’s filter button: filtering can hide categories or series without changing the source range you edited.
- Labels appear in the wrong order: Check the order of the source cells. For category charts, Excel normally follows the order of the selected range. Sorting the worksheet data can change the chart’s displayed order.
- Only some labels show: Excel may automatically skip labels when there is not enough room to display every one. Widen the chart, reduce label font size, or adjust the axis label interval in Format Axis options.
- Numbers appear as categories: A line chart can treat numbers as category labels rather than numeric positions. Change to an XY (Scatter) chart if the numeric spacing between x-values matters.
- Scatter points do not match the intended x-values: Edit the series and check both X and Y ranges. Verify that the first x-value corresponds to the first y-value and that neither range includes a heading unless the series is configured accordingly.
- Excel will not accept the selected range: Check for incompatible or mismatched range lengths, and select cells rather than entire columns if the chart expects a defined set of points. Make sure the selected cells contain the intended data and are in the correct worksheet.
Axis formatting can also make correct data look wrong. For example, a date axis may show only some date labels to prevent crowding, or a numeric axis may use bounds and units that compress the visible differences. To investigate, right-click the axis and choose Format Axis. Formatting changes the display scale or labels; it does not replace the chart’s source data.
Keep the chart’s x-axis data up to date
If you expect to add rows regularly, consider converting the source data into an Excel table before creating the chart. Select the data and choose Insert > Table, then create the chart from the table. Tables generally expand when you add rows directly below them, and charts based on the table can include the new records. Check the chart after adding data, particularly if you have set a separate axis-label range or customized series references.
For a chart that already exists, adding new cells outside its current source range may not make those cells part of the chart automatically. Use Chart Design > Select Data to inspect or adjust the range. You can also use the chart’s colored range outlines, when visible, to see which worksheet cells currently supply its data. A table is helpful for ongoing lists, but it does not remove the need to confirm that the chart includes the intended columns.
When the workbook is shared, keep labels and values in clearly named columns and avoid inserting unrelated rows inside the source data. This makes it easier for another person to identify whether the chart is using category labels or scatter x-values. A descriptive axis title, added through Chart Design > Add Chart Element > Axis Titles, can clarify what the horizontal scale represents; it changes the title, not the underlying data.
Excel for Mac and Excel for the web
In current desktop versions of Excel for Mac, select the chart and look for Chart Design > Select Data; the dialog provides controls for category labels and series data. Ribbon placement and dialog appearance can vary slightly by build, but the distinction between category labels and scatter-series X values remains. The Windows instructions above use ribbon paths, so a Mac user should follow the same chart-selection logic and use the corresponding Chart Design controls.
Excel for the web supports chart editing, but its available controls can differ from the desktop app, and some detailed chart changes are easier to make in Excel for Windows or Mac. If the web interface does not expose the range-editing control you need, open the workbook in the desktop application and use Chart Design > Select Data. Avoid assuming that changing the worksheet selection alone changes an existing chart’s source range; the chart’s data settings determine what it plots.
Frequently Asked Questions
How do I select the x-axis in an Excel chart?
Select the chart and choose Chart Design > Select Data. For category-based charts, click Edit under Horizontal (Category) Axis Labels and select the label cells. For a scatter chart, edit the series’ Series X values.
Why can’t I edit the x-axis labels in Excel?
You may be looking at a scatter chart, which uses numeric X values for each series instead of a shared category-label range. Open Select Data and edit the series. If it is a category chart, ensure the chart is selected and use the Edit button beside Horizontal (Category) Axis Labels.
How do I change the x-axis numbers in a scatter plot?
Open Chart Design > Select Data, choose the series, and click Edit. Select the desired cells for Series X values, then confirm that the corresponding Series Y values are aligned with them.
Can I use text for the x-axis in an Excel scatter chart?
A scatter chart positions points using numeric x-coordinates, so text category names are not suitable as meaningful x-values. Use a line or column chart for text categories, or use numeric coordinates and display labels separately if the chart requires a numeric scale.
How do I make Excel show every x-axis label?
First confirm that the selected label range contains every intended label. If Excel is skipping labels because the chart is crowded, widen the chart or use Format Axis to adjust the label interval. Showing every label may make them overlap, so shorter labels or a larger chart can improve readability.
Related
- Checklist Template Excel: Set Up, Track, and Reuse Tasks
- Excel Drop-Down Lists: How to Create and Manage Them
- How to Insert a Checkbox in Excel: Steps and Tips
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Double Stacked Bar Chart in Excel: How to Create OneTo create a double stacked bar chart in Excel, put each bar you want to compare on its…
- Pivot Power Skating: How to Turn, Train, and ImprovePivot power skating is the practice of changing from forward to backward skating, or backward to forward, while…
- Excel Chart: How to Align Zero on a Secondary AxisTo align zero on an Excel chart’s secondary axis with zero on its primary axis, set fixed minimum…
- Excel Sunburst Chart Data Layout: A Practical GuideFor an Excel sunburst chart, put each level of the hierarchy in its own column, from the broadest…
- Consolidate Multiple Pivot Tables in ExcelTo consolidate information shown in multiple PivotTables, combine their underlying data first, then build one PivotTable from the…
- Excel Pivot Chart Histogram: What Works and What Doesn’tExcel does not provide a true Histogram chart as a PivotChart type. You can, however, group numeric values…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.