To reverse the x and y axis in Excel, you have two main options: swap the data series between the horizontal and vertical axes (which changes which variable is plotted on which axis), or flip the direction of an existing axis (so values increase from right to left or top to bottom). For swapping axes, select the chart, go to Chart Design > Select Data, and use the Switch Row/Column button. For reversing the direction of a single axis, right-click the axis, choose Format Axis, and check the “Values in reverse order” box.
What “Reversing” an Axis Actually Means
People use the phrase “reverse x and y axis” in two different ways, and the fix depends on which one you mean.
- Swapping the axes – changing which data series is plotted on the horizontal (x) axis and which is on the vertical (y) axis. This is common when you have a table where the row and column headers are in the “wrong” place for your chart.
- Reversing the direction – flipping the scale so that the minimum value appears at the opposite end of the axis. For example, a time axis that normally goes left-to-right (oldest to newest) can be reversed to show newest on the left.
Both operations are quick, but they use different commands. The rest of this article covers both, with step-by-step instructions for Excel for Microsoft 365 on Windows, plus notes for Mac and Excel for the web where they differ.
How to Swap X and Y Axes (Switch Row/Column)
If you want to change which variable is on the horizontal axis versus the vertical axis, the fastest method is the Switch Row/Column command. This works for most 2-D chart types (column, bar, line, scatter, and area).
- Click anywhere on your chart to select it.
- Go to the Chart Design tab (it appears only when the chart is selected).
- Click Select Data (on the far left of the ribbon).
- In the dialog box that opens, click the Switch Row/Column button in the top-left corner.
- Click OK.
On a Mac, the ribbon is similar: select the chart, go to Chart Design > Select Data, then click Switch Row/Column. In Excel for the web, select the chart, click the Chart Design tab, then choose Select Data and click Switch Row/Column.
This swaps the categories and series. For example, if your data has months in column A and sales in column B, a column chart normally puts months on the x-axis and sales on the y-axis. After switching, it will put sales on the x-axis and months as the series (which is rarely useful for a column chart, but for a scatter plot it can be exactly what you need).
For scatter charts, switching row/column swaps the X values and Y values series. If you have two columns of numeric data (e.g., height in A2:A10 and weight in B2:B10), a scatter chart normally plots height on the x-axis and weight on the y-axis. After switching, weight becomes x and height becomes y.
How to Reverse the Direction of an Axis (Values in Reverse Order)
If you want to flip the scale itself – for example, so the largest value is at the bottom of a vertical axis, or the earliest date is on the right – use the Format Axis pane.
- Right-click the axis you want to reverse (the horizontal or vertical axis numbers).
- Choose Format Axis from the context menu.
- In the pane that opens on the right, look for Axis Options (the bar chart icon).
- Under Bounds, check the box that says Values in reverse order.
On a Mac, right-click (or Control-click) the axis, select Format Axis, and the same checkbox appears in the Format Axis pane. In Excel for the web, right-click the axis and choose Format Axis; the checkbox is there as well.
This reverses the numeric order. For a horizontal axis, the minimum value moves to the right; for a vertical axis, the minimum moves to the top. This is handy when you want a “top-down” view, like a Gantt chart where tasks are listed from top to bottom in chronological order.
Which Method Should You Use?
Choose based on what you’re trying to achieve:
- If your data is in the wrong orientation (rows vs. columns) and the chart looks “sideways,” use Switch Row/Column.
- If you want to change the scale direction (e.g., reverse time order), use Values in reverse order.
- If you have a scatter plot and the x and y data columns are swapped, you can either use Switch Row/Column or manually edit the series to point to the correct columns.
A common mistake is trying to use Switch Row/Column on a pie or doughnut chart – these chart types have no axes, so the button is grayed out. For those, you’d need to reorganize your source data instead.
Common Problems and How to Fix Them
Here are typical issues people run into when reversing axes:
- Switch Row/Column is grayed out. This happens when the chart type doesn’t support it (pie, doughnut, radar) or when the chart is a 3-D type. Switch to a 2-D chart type first.
- Axis labels disappear after reversing. When you reverse a category axis, the labels may flip to the other side. Right-click the axis, choose Format Axis, and under Labels, set Label Position to Low or High to control where they appear.
- Data points move unexpectedly. If you reverse a value axis, the data points will mirror across the other axis. That’s expected, but if it looks wrong, double-check which axis you reversed.
- Scatter plot doesn’t swap the way you expect. For scatter charts, Switch Row/Column swaps the entire series, not just the x and y ranges. To swap only the x and y columns for a single series, edit the series directly: right-click the series, choose Select Data, then Edit, and change the X and Y values.
Reversing Axis in a PivotChart
PivotCharts behave slightly differently because they are linked to a PivotTable. You can still use Switch Row/Column and Values in reverse order, but the changes affect the underlying PivotTable’s field arrangement. If you switch row/column, the PivotTable’s row and column fields swap. If you reverse an axis, it only affects the chart display, not the PivotTable data.
To reverse a PivotChart axis direction, follow the same steps as a normal chart: right-click the axis, Format Axis, check Values in reverse order. To swap the axes, go to Chart Design > Select Data > Switch Row/Column, or drag fields in the PivotTable Field List to swap the Row and Column areas.
Frequently Asked Questions
Why does my Excel chart have the x and y axis mixed up?
Most often this happens because your source data is organized in rows instead of columns (or vice versa). Excel’s default charting assumes that the first row or column contains category labels and the rest are series. If your data is transposed, the chart will look swapped. Use Switch Row/Column to fix it quickly.
Can I reverse only the x-axis without affecting the y-axis?
Yes. Right-click the x-axis (the horizontal one), choose Format Axis, and check “Values in reverse order.” The y-axis remains unchanged. Similarly, you can reverse the y-axis alone by right-clicking it.
Does reversing an axis change my data?
No. It only changes the display of the chart. The underlying cell values remain untouched. This is true for both Switch Row/Column and Values in reverse order.
How do I make a scatter plot with the x and y columns swapped?
Select the chart, go to Chart Design > Select Data, click Edit under the series, and then change the X values and Y values ranges to the opposite columns. Alternatively, use Switch Row/Column if you have only one series and it swaps the entire series.
Why is the “Values in reverse order” checkbox missing?
That checkbox appears only when you right-click an axis and open Format Axis. If you opened the pane for the plot area or data series, you won’t see it. Also, make sure you selected the axis itself, not the chart area.
Will reversing an axis work in Excel for Mac or web?
Yes. Both features exist in Excel for Mac and Excel for the web. The steps are nearly identical; on Mac, right-click (or Control-click) to access Format Axis, and the Switch Row/Column button is in the Chart Design tab.
Related
- Excel: How to Hide Rows in a Table (3 Ways)
- Excel Split Cells Fast: 4 Ways That Work
- Excel: How to Count X’s in a Column
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Excel Pivot Chart: Hide Field Buttons and Show Them AgainTo hide the buttons on an Excel PivotChart in Microsoft 365 for Windows, select the chart and choose…
- Excel Clustered Column Chart Overlap: Causes and FixesYes—columns in an Excel clustered column chart can overlap when the series overlap setting is above 0%, or…
- Excel Pivot Table Filter: Show Multiple Items at OnceYes. In Excel for Microsoft 365 on Windows, open the PivotTable field’s filter dropdown, turn on Select Multiple…
- Excel Chart Data Table: Can You Change Its Text?Yes—but you generally cannot edit values by typing directly into an Excel chart’s data table. In Excel for…
- Excel Data Model Pivot Table Calculated Field?Yes, you can add calculated fields to a PivotTable that uses the Excel Data Model, but not through…
- Excel Column Chart With Percentage Change: How to Show ItTo show percentage change on an Excel column chart, calculate the change between periods, then either use those…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.