Want to become an expert in VBA? So this is the right place for you. This blog mainly focus on teaching how to apply Visual Basic for Microsoft Excel. So improve the functionality of your excel workbooks with the aid of this blog. Also ask any questions you have regarding MS Excel and applying VBA. We are happy to assist you.

Swap Axis of an Excel Chart Without Changing Excel Sheet Data

This post explains how you can swap the axis of an Excel chart without swapping values in the sheet. Assume we have an Excel sheet like this.

Sample Excel sheet

If we select the data and insert a “Scatter with smooth lines” chart, then we will get a chart like this.

Scatter with smooth lines chart

Or else we can insert a “Line” chart like this.

Line chart

If you look at these charts, you can see that names are in the x axis. In the line chart names are visible in the x axis. But the Scatter chart shows some numbers instead of the names. Yet if you take the cursor to the Scatter chart it will show you the data points like this.

Data point
Another data point for same name

Therefore it is clear that the Scatter chart also has names in the x axis.

But then these charts don't make much sense according to how the Excel application has chosen the x axis. But it will be more understandable if we can set “Tests” as x axis instead of “Names”. One way to do that is re-arranging the data in the Excel sheet. However there is an easier way to do that without doing any change to the Excel data. We can simply do that by changing the x axis of the chart. Below are the steps to change the x axis.

First click somewhere on the chart. You will see two new tabs appear at the Excel ribbon called “Design” and “Format”.

Click somewhere on the chart

Go to the design tab and click on the “Switch Row/Column” icon in the “Data” Group.

Click on the Switch Row/Column

Scatter chart will change to something like this.

Scatter chart - axis swapped

You can do the same for the line chart as well.

Line chart - axis swapped

Contact Form


Email *

Message *