Excel Scatter Plot: How to Swap X and Y Axes

How-to basics · Updated November 21, 2026

To swap the X and Y data in an Excel scatter plot, select the chart, choose Chart Design > Select Data, select the series, and click Edit. Exchange the ranges in Series X values and Series Y values, then confirm the changes. This changes which data is plotted on each axis; it does not rearrange the worksheet cells.

What swapping the axes means in a scatter plot

An Excel scatter plot, also called an XY chart, plots paired numeric values as coordinates. Each point has an X value and a Y value: Excel uses the first range in the series settings for horizontal position and the second for vertical position. Swapping the ranges means that every point at (x, y) is instead plotted at (y, x).

For example, suppose column A contains hours studied and column B contains test scores. If hours are assigned to X and scores to Y, the chart shows how scores vary with study time. Swapping the series ranges puts scores on the horizontal axis and hours on the vertical axis. The plotted relationship is reflected across the chart’s diagonal when both axes use the same scale, but the chart’s appearance may not look like a simple mirror if the axes have different bounds or units.

This operation is about the data assignments, not the location of the axes on the page. It does not move the vertical axis to the right, reverse the order of values, or switch the worksheet columns. Those are separate formatting or data-layout changes.

Swap the X and Y ranges in Excel for Windows

In Microsoft Excel for Microsoft 365 on Windows, edit the chart series directly. Keep the two ranges the same length so that each X value remains paired with its corresponding Y value.

  1. Click the scatter plot. If the chart contains multiple series, identify the one whose axes you want to swap.
  2. Open the contextual Chart Design tab on the ribbon and choose Select Data. Excel opens the Select Data Source dialog box.
  3. Under Legend Entries (Series), select the relevant series and click Edit.
  4. In the Edit Series dialog box, exchange the cell references in Series X values and Series Y values. For example, if the X range currently refers to the hours in A2:A6 and the Y range refers to scores in B2:B6, put the B2:B6 range in the X field and the A2:A6 range in the Y field.
  5. Click OK to close Edit Series, then click OK again to close Select Data Source. Check the chart and its axis titles.

Use the range-selection buttons beside the fields if selecting cells directly is easier than editing the references by hand. When selecting ranges, select only the values, not the header row. Excel may show the worksheet name in a reference; that is normal. The source data stays where it is, and the chart updates to use the revised series assignments.

What to do in Excel for Mac or Excel for the web

In Excel for Mac, select the chart and look for Chart Design > Select Data. Select the series, choose Edit, and exchange the X and Y ranges in the series settings. Ribbon labels and dialog layout can vary slightly by Mac release, but the key is to edit the series’ X values and Y values rather than trying to drag the axes.

Excel for the web supports chart editing, but some chart commands and detailed series controls can differ from the desktop app and may not be available for every chart. If you cannot find the series edit controls, open the workbook in the Excel desktop app and make the change there. After editing in the desktop app, save the workbook so the updated chart appears for people viewing it online.

Check the chart type and data layout first

The instructions above apply to an XY scatter chart. In that chart type, both axes represent values, and each series has its own X and Y ranges. A line chart behaves differently: its horizontal axis is generally a category axis, such as dates or labels, and its series are primarily defined by their Y values. If the chart is a line chart, swapping two ranges in the scatter-series fields may not be an option because those fields belong to XY series.

To check the chart type, select the chart and use Chart Design > Change Chart Type. Choose an XY (Scatter) option if the data represents paired numerical measurements. Common choices include scatter with markers only, scatter with straight lines and markers, or scatter with smooth lines and markers. Changing to a scatter chart is not automatically the right fix, however: use it when both variables are numeric and their actual spacing matters.

A typical data layout has one column for each variable, with matching observations on the same rows. For example:

  • Column A: hours studied, with values in A2:A6.
  • Column B: test scores, with values in B2:B6.
  • Each row represents one student, so A2 must stay paired with B2, A3 with B3, and so on.

Swapping the series fields changes which member of each pair is horizontal; it does not change the pairing. Do not sort one column independently of the other, because that would attach measurements to the wrong observations and create a different dataset.

Choose the right axis assignment and labels

The usual convention is to put the explanatory or input variable on the X axis and the response or outcome on the Y axis. For example, elapsed time is commonly X and measured temperature is commonly Y. This convention makes a chart easier to interpret, but it is not an Excel rule. If your question is how one variable changes in relation to another, assign the variables in the direction that makes that relationship clearest.

After swapping, review the axis titles. If the chart previously had titles such as Hours studied and Test score, those labels may now describe the wrong axes even though the data has changed correctly. Select a title and replace its text, or use Chart Design > Add Chart Element > Axis Titles to add titles if they are missing. Include units where relevant, such as Time (hours) or Distance (meters).

Also check the scales. Hours and scores may use different ranges, so exchanging them can change the visual proportions and make the point pattern appear steeper or flatter. Excel may adjust the automatic minimum and maximum for an axis after the data changes. If you need fixed bounds, right-click the relevant axis, choose Format Axis, and review the bounds in Axis Options. A fixed scale can help compare charts, but it can also hide variation if the bounds are poorly chosen.

Common problems and how to fix them

  • The chart did not change: Confirm you edited the series shown in the chart, not a different series. For a chart with several series, repeat the change for each series that needs to be swapped.
  • The dialog has no X and Y fields: The chart may be a line or another non-scatter type. Check the chart type and change it to XY (Scatter) if that fits the data.
  • The plotted points disappear or look wrong: Check that both fields refer to numeric ranges, that neither range includes a header as a data point, and that the ranges contain the same number of cells. Also verify that the values are on matching rows and have not been separated by sorting or filtering.
  • Text appears on an axis unexpectedly: An XY chart needs numeric values for its coordinates. Text values, blank cells, or numbers stored as text can behave differently from ordinary numbers. Inspect the source cells and convert values to numbers if needed.
  • The axis titles no longer match: Update the titles after changing the ranges. The title text is separate from the series data, so Excel may not rewrite a custom title to reflect the new assignment.
  • The chart looks unlike a diagonal reflection: The axes may have different units, scales, or bounds. A swap exchanges the values but does not force equal axis scales or identical formatting.

Swapping data is different from reversing an axis

A frequent source of confusion is the difference between swapping X and Y data and reversing an axis. Swapping changes the coordinates: the values formerly used as X become Y, and vice versa. Reversing an axis changes the order in which values are displayed, such as putting larger values on the left and smaller values on the right, without exchanging the data fields.

To reverse an axis, right-click that axis, choose Format Axis, and use the relevant axis option to reverse the order of values. The available wording depends on whether you are formatting the horizontal or vertical axis. This is useful for a deliberate display choice, such as showing a descending scale, but it does not answer a request to make one variable the X variable and the other the Y variable.

Likewise, Chart Design > Switch Row/Column is not a dependable substitute for editing an XY series. That command changes how Excel interprets rows and columns as series or categories in chart types where those groupings apply. For a scatter plot, use the Edit Series dialog and exchange the two value ranges explicitly.

Alternative: rebuild the scatter plot from selected columns

If the chart has become difficult to manage, you can create a fresh scatter plot from the two columns in the desired order. Select the intended X values and Y values, then choose Insert > Insert Scatter (X, Y) or Bubble Chart and choose a scatter subtype. When the columns are adjacent, selecting both with their headers is straightforward. If they are separated, select the first range and then use the appropriate multiple-selection method for your Excel version, or create the chart from one range and add or edit the series afterward.

Rebuilding can be useful when the existing chart has several confusing series or inherited formatting. It may also mean reapplying titles, colors, gridlines, and other formatting, so editing the existing series is usually quicker when the chart is already styled. In either case, inspect the plotted points against a few source rows to make sure the intended values are paired.

Frequently Asked Questions

Can I swap the X and Y axes without changing my worksheet data?
Yes. Edit the scatter plot series and exchange the ranges in Series X values and Series Y values. The cells remain in their original columns; only the chart’s interpretation of those ranges changes.

Can I swap X and Y for only one series?
Yes. In Select Data, edit only the series you want to change. Other series remain as they are. If you want every series to use the opposite assignment, edit each series separately and check that its X and Y ranges still refer to corresponding observations.

Why can’t I find Series X values and Series Y values?
Those fields are part of the series settings for an XY scatter chart. If the chart is a line chart or another chart type, switch to a suitable XY (Scatter) type or keep the existing chart type and use the controls appropriate to it.

Does switching the axes change the correlation or the data?
No source values change, and exchanging X and Y does not change the strength of the linear association between the paired measurements. It does change which variable is treated as horizontal and vertical, and it can affect how people interpret the chart or how a trendline equation is presented.

How do I move the vertical axis to the right side?
That is an axis-position formatting change, not an X/Y data swap. Select the horizontal axis, open Format Axis, and review the setting for where the vertical axis crosses. The exact option depends on the chart’s scale and the result you want.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

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

Spotted an error in this guide? Let us know.