How to Switch X and Y Axis in Excel
(Flip Chart Axes)

Written by co-founder Kasper Langmann, Microsoft Office Specialist.

Knowing how to switch the x-axis and y-axis in Excel will save you a lot of trouble. 

Microsoft Excel is powerful spreadsheet software that will let you store data and make calculations on it. You can then visualize the data using built-in charts and graphs.

However, there are times when you have to switch the value series of the chart’s axes.

And if you don’t know how, your only choice is to exchange the columns or values manually.

Download the sample workbook here to tag along as you read this guide.

In this article, we’ll show you how to switch x and y axes in Excel.

Kasper Langmann, Co-founder of Spreadsheeto

The X-Axis and Y-Axis

Most graphs and charts in Excel, except for pie charts, has an x and y axes where data in a column or row are plotted.

By definition, these axes (plural of axis) are the two perpendicular lines on a graph where the labels are put.

Kasper Langmann, Co-founder of Spreadsheeto

Here’s an example of an Excel line chart that shows the X and Y axes:

line chart excel with x and y axis data

The x-axis is the horizontal line where the months are named. The y-axis is the vertical line with the numbers.

Why switch the axes

There are times when you have to arrange the variables in the spreadsheet before making a chart out of them.

Like in the case of making a scatter chart. It’s recommended that the independent variable should be on the left while the dependent variable should be on the right.

But of course, that’s not general knowledge. So chances are, some people would have swapped them.

This is just one example of a scenario where knowing how to switch axes would come in handy.

Kasper Langmann, Co-founder of Spreadsheeto

In this tutorial, we’ll borrow this data set from the scatter plot tutorial where the values in the left (B) and right column (C) isn’t the recommended arrangement.

data series with pageviews and sales values for scatter graph

The chart still works. However, the “Pageviews” value series should be on the y-axis (horizontal line) while the “Sales” value series should be on the x-axis (vertical line).

How to switch the x and y axis

If you don’t know how to switch the axes, you would’ve deleted the chart and copy-pasted the contents of columns B and C to exchange the values.

There’s a better way than that where you don’t need to change any values.

First, right-click on either of the axes in the chart and click ‘Select Data’ from the options.

select data option after right-clicking an axis

A new window will open.

Click ‘Edit’.

click edit option on select data source window

Another window will open where you can exchange the values on both axes.

What you have to do is exchange the content of the ‘Series X values’ and ‘Series Y values’.

You can use notepad and copy the values. Then, simply paste them on each form.

Kasper Langmann, Co-founder of Spreadsheeto

Your goal is to change the values from this:

choose new x and y axis series values to switch sales values with pageviews in the scatter chart

To this:

insert the copied references to the y axis and x axis in the scatter chart

Once you do that, the value series on the axes would be swapped.

the y axis has now been switched with the x axis

Notice that we didn’t change any values on the spreadsheet data at all. All we did was customized the chart.

That’s it – Now what?

You just learned how to switch x and y axis in Excel in a few minutes.

Microsoft Excel’s charts are so advanced that you can swap the horizontal axis values with the vertical axis values without touching the original data on the spreadsheet.

Pretty cool, right?😎

Now, charts are only useful if you have numbers to show. And those numbers are typically derived from some sort of calculation.

The best functions for calculations or helping with calculations are SUMIF, IF, and VLOOKUP.

If you want to learn those, please enroll in my free 30-minute online Excel course here. We’ll send it directly to your inbox📩

Other resources

While you’re learning about charts you might want to check out my huuuuge guide to all Excel charts (and how to use them).

Frequently asked questions

1. Right-click the chart y axis (or x axis) and choose Select Data from in the pop-up window.

2. Click the Edit button

3. Select and copy the Series X values reference into Notepad

4. Do the same with the vertical axis (y axis values)

5. Insert the copied Y series values into the X values field

6. Insert the copied X series values into the Y values field

7. Click OK