How to Switch Horizontal and Vertical Axis in Excel
In this article
Switching the horizontal and vertical axis in Excel swaps the data displayed on the X-axis and Y-axis of a chart, which can make trends easier to read or better fit your presentation layout. This is useful when your categories are too long for the horizontal axis or when you want to emphasize changes over time as rows instead of columns. No special tools or add-ins are required—this works in all modern versions of Excel for Windows and Mac.
What You'll Need
- An Excel file with a chart already created (column, bar, line, or area chart)
- Access to the Excel desktop application (Windows or Mac)
- The chart must be based on a data range with at least one series of numerical values and one set of category labels
Step-by-Step
- Click on the chart you want to modify to select it. You’ll see border handles appear around the chart and the Chart Tools tabs will appear at the top of the Excel window.
- Go to the Chart Design tab in the ribbon (this appears only when the chart is selected).
- Click on Select Data in the Data group. This opens the Select Data Source dialog box.
- In the Select Data Source dialog, look at the list on the left labeled Legend Entries (Series). This shows each data series in your chart.
- Click on the first series in the list, then click the Switch Row/Column button near the bottom of the dialog box.
- Preview the chart in the dialog box—the horizontal and vertical axes should swap positions. If the chart looks correct, click OK.
- Return to your worksheet. The chart should now display categories on the vertical axis and values on the horizontal axis, effectively switching the orientation.
Common Mistakes
- Trying to switch axes by manually dragging data points—this does not work. Axis switching requires using the Select Data tool, not reshaping the chart visually.
- Using a pie chart or doughnut chart, which cannot have their axes switched because they don’t use X and Y axes in the same way as bar or column charts.
- Forgetting to select the chart before opening the Select Data dialog—without selection, the Chart Design tab won’t appear and the option will be grayed out.
- Switching axes on a chart with only one data series and no category labels—Excel may not recognize the data structure properly, leading to a blank or distorted chart.
- Assuming the data table itself changes—switching axes only affects the chart’s visual representation, not the underlying data in your worksheet.
Tips
- Before switching, save a copy of your chart or worksheet so you can revert if needed. This is especially helpful when working with complex charts.
- For horizontal bar charts (which already display categories vertically), switching axes will convert them to vertical column charts. Use this to toggle between orientations quickly.
- If your category labels are long (e.g., product names or dates), switching to a horizontal bar chart often improves readability by preventing overlap.
- After switching, adjust the axis formatting: right-click the axis, choose Format Axis, and tweak label rotation, font size, or number formatting to enhance clarity.
- Line and area charts also respond to the Switch Row/Column function, but the visual change is less dramatic—it swaps how data series are grouped along the X-axis.
- Use the Chart Elements button (the + icon next to the chart) to toggle gridlines, data labels, or axis titles after switching to ensure the chart remains clear.
Troubleshooting
- If the Switch Row/Column button is grayed out, make sure you’ve selected a chart type that supports dual axes—bar, column, line, or area charts only. Pie, radar, and scatter plots do not support this feature.
- If the chart appears scrambled after switching, check that your data range includes consistent headers for both rows and columns. Missing or misaligned headers can confuse Excel’s interpretation.
- If categories disappear, verify that the data range in the Select Data Source dialog includes the correct column or row for category labels. Click Edit under Horizontal (Category) Axis Labels and reselect the range of labels.
- If Excel says “No data in chart” after switching, your original data may have been formatted as text instead of numbers for the Y-axis values. Ensure all numerical values are formatted as numbers, not text.
- If the chart doesn’t update after clicking OK, try clicking outside the chart and then back on it to force a refresh. Sometimes Excel’s display engine needs a nudge.
- On Mac, the ribbon layout is slightly different. If you don’t see Chart Design, go to the Chart menu at the top of the screen and choose Select Data from there.