Excel Graph: How to Switch the X and Y Axes in a Chart

Charts & pivot tables · Updated November 18, 2026

To switch the X and Y values in an Excel chart, use an XY (Scatter) chart, then go to Chart Design > Select Data, select a series, choose Edit, and swap the ranges in Series X values and Series Y values. For a line or column chart, Switch Row/Column changes how Excel groups the data; it does not directly exchange numeric X and Y coordinates.

Why chart type matters

Excel uses “axis” to describe more than one chart feature. In a scatter chart, both axes are value axes: the horizontal axis plots each point’s X value, and the vertical axis plots its Y value. These charts are suited to paired numeric measurements, such as temperature and electricity use, or distance and travel time. Switching the series ranges changes which measurement appears on each axis.

In a line, column, or bar chart, one axis commonly represents categories—such as months, product names, or regions—and the other represents numeric values. Excel treats the category labels differently from scatter-chart coordinates. As a result, clicking Switch Row/Column can reorganize which data series appear, but it does not simply turn the horizontal category axis into a numeric vertical axis and vice versa. If you need to exchange two numeric variables, a scatter chart is usually the right starting point.

Switch X and Y values in a scatter chart

These steps apply to Excel for Microsoft 365 on Windows. Suppose column A contains sample names, column B contains hours studied, and column C contains test scores. A scatter chart that plots hours studied on X and score on Y uses the values in B as the series’ X range and values in C as its Y range.

  1. Select the chart. If it is not already a scatter chart, choose Chart Design > Change Chart Type, select XY (Scatter), choose a scatter style, and click OK.
  2. With the chart selected, choose Chart Design > Select Data.
  3. In the data source window, select the series you want to change and click Edit. If the chart has several series, edit each one that should be reversed.
  4. In Edit Series, put the range currently used for Y into Series X values, and put the range currently used for X into Series Y values.
  5. Click OK to close the series dialog, then OK again to close the data source window. Check the axis titles and chart shape to confirm the change makes sense.

For the example, if X currently uses the hours in B2:B6 and Y uses the scores in C2:C6, set X to the score range and Y to the hours range. The values in column A can be used as point labels if you add data labels, but they are not the numeric coordinates in this setup. If the series boxes show worksheet references, keep the references on the correct sheet and include the same number of data points in both ranges.

Switch rows and columns for category charts

If your chart is a line, column, or bar chart and your goal is to change which records form series, select the chart and choose Chart Design > Switch Row/Column. For example, a table with months down the first column and separate sales columns for two stores may plot each store as a series. Switching rows and columns can instead plot each month as a series. The exact result depends on the layout and headers in the selected data range.

This command is useful when the chart is grouping the data in the opposite way from what you intended. It is not the same as changing X and Y in a scatter chart. With category charts, Excel may keep the category labels on the category axis while rearranging series. If your objective is to compare two numeric measures as paired points, change the chart type to XY (Scatter) and edit the series ranges instead.

Choose the right chart for your data

Decide what the horizontal axis is meant to communicate before changing settings. A category chart is often clearer when the X direction represents ordered labels, such as quarters or named departments. A scatter chart is more appropriate when horizontal position represents a number and the spacing between values matters. For instance, a scatter chart can show that observations at 10 and 20 units are farther apart than observations at 10 and 11; a category axis generally treats labels as separate positions rather than numeric distances.

  • Use a scatter chart for paired numeric observations, numeric X values with uneven intervals, or a relationship between two measurements.
  • Use a line chart to show a trend across ordered categories or time periods when the labels are the main horizontal structure.
  • Use a column or bar chart to compare amounts among categories, such as sales by product or totals by region.

For example, to examine whether advertising spend is related to sales, place spend on X and sales on Y in a scatter chart. If the purpose is simply to compare total sales across named regions, a column or bar chart is more direct. Swapping values without considering the question can make a chart technically valid but harder to interpret.

What to check when the chart looks wrong

If the chart does not change as expected, first check the chart type and the series being edited. A chart can contain several series, and changing one will not automatically change the others. Also inspect the selected ranges: a header cell or a label column accidentally included as a coordinate can cause missing points, an unexpected legend entry, or confusing axis values.

  • Unequal range lengths: X and Y should contain matching numbers of observations. If one range includes an extra header or blank row, the plotted pairs may not match as intended.
  • Numbers stored as text: Numeric-looking cells stored as text may not plot as numeric coordinates. Check the source cells and convert them to numbers where appropriate.
  • Blank or hidden data: Missing values can create gaps or omit points, depending on the chart and settings. Review the source table and the chart’s selected range.
  • Unexpected scale: A few very large values can compress the rest of the points. Review the axis bounds and number format before concluding the data is wrong.
  • Labels mistaken for values: A scatter chart needs numeric X and Y values. Text names belong in labels or another field, not in the coordinate ranges.

After reversing the ranges, update axis titles because the old labels may now describe the wrong measurement. Also check whether a trendline or other series-specific element still communicates what you intend. If your chart has multiple series, verify that each one uses the appropriate X range; series do not have to share the same X values.

Axis order, scale, and direction

Swapping X and Y data is different from reversing an axis direction or changing its scale. If the measurements are already assigned to the intended axes but you want values to run from high to low, use the axis formatting options rather than editing the series. Select the axis, open Format Axis, and review the available axis options. The choices vary according to the chart type and whether the selected axis is a value or category axis.

Likewise, setting minimum and maximum bounds changes the displayed scale; it does not swap the underlying data. Be cautious when adjusting bounds because a cropped scale can make differences look larger or smaller than they are. For a scatter chart, the X and Y axes can have different units and ranges—for example, spend in dollars and sales in units—so their numerical scales do not need to match.

Excel for Mac and Excel for the web

In Excel for Mac, the chart workflow is broadly similar: select the chart, use the chart design controls to open Select Data, choose the series, and edit its X and Y values. Ribbon placement and dialog layout can differ slightly from Windows, so look for the chart design tab that appears when the chart is selected. The key task remains assigning the two data ranges to the correct series fields.

Excel for the web has chart editing controls, but some chart operations and dialogs may be more limited or laid out differently than in the Windows desktop app. If you cannot access the series-level X and Y fields in your browser, open the workbook in the desktop version of Excel and make the change there. The Windows directions above are for Microsoft 365 desktop Excel, not a guarantee that every interface has identical buttons.

Frequently Asked Questions

Can I switch the X and Y axes with one click in Excel?
Not for the numeric X and Y ranges in a scatter chart. Edit the series and exchange the ranges in Series X values and Series Y values. Switch Row/Column is a different command for reorganizing chart series.

Why is the Switch Row/Column button not swapping my axes?
It changes whether Excel treats rows or columns as separate data series. It does not exchange the numeric coordinates of an XY scatter series. For that, use Select Data and edit the series.

Can I swap axes in a line chart?
You can reorganize its rows and columns with Chart Design > Switch Row/Column, but a line chart uses categories along one axis. To plot two numeric variables against each other, change it to an XY (Scatter) chart and assign the X and Y ranges.

Do both scatter-chart axes have to use the same scale?
No. Each axis can show a different measurement and range. Use axis bounds and number formats that suit each variable, and label the axes so readers can tell what each scale represents.

Can the X-axis show names instead of numbers?
A scatter chart’s X coordinates are numeric. You can add point labels from cells to show names near the markers, or use a category chart if named categories are the main purpose. The chart type should match whether horizontal position represents a number or a label.

A quick way to verify the result

Before sharing the workbook, select a point and compare its plotted position with the source row: its horizontal location should correspond to the value now assigned to X, and its vertical location should correspond to the value assigned to Y. Confirm that all series have the intended ranges, the axis titles match the variables, and the chart type fits the question. That final check helps distinguish a true X/Y swap from a simple change in series grouping or axis formatting.

Related

Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.

More in Charts & pivot tables

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.