XY Chart in Excel: How to Create a Scatter Plot
In this article
An XY chart in Excel is a scatter plot: it plots one numeric value against another, so each point sits at the intersection of an X value and a Y value. To make one, put your X values in the left column and your Y values in the right column, select the data, then go to Insert > Charts > Scatter and pick the style you want. That is the whole job for most cases. The rest of this guide covers how to set it up cleanly, how to add labels and a trendline, and what to check when the chart looks wrong.
What You'll Need
- Excel for Windows, Mac, or Excel for the web (the menu names are almost identical across all three).
- Two columns of numeric data: one for the X values and one for the Y values, with the same number of rows.
- Column headers if you want Excel to name the series for you.
Step-by-Step
- Lay out the data in two columns. Put the X values in the left column and the Y values in the right column. For example, A1 could be "Hours" and B1 "Score", with the numbers below. Do not put a blank row in the middle of the data.
- Select the range including the headers. Click the top-left cell of your data and drag to the bottom-right cell, or press Ctrl+A (Cmd+A on Mac) with a cell inside the data selected. If you select only the numbers, Excel still plots them but the series will be called "Series1".
- Go to Insert > Charts > Scatter. The Scatter button looks like dots on a grid. Click it to open the chart type menu.
- Choose a style. "Scatter" shows points only. "Scatter with Smooth Lines" and "Scatter with Straight Lines" connect the points in the order they appear in the sheet. "Scatter with Smooth Lines and Markers" is the most common choice when you want to see both the points and the trend between them.
- Check the axes. Excel plots the left column on the horizontal (X) axis and the right column on the vertical (Y) axis. If your chart is the wrong way round, see the Common Mistakes section below.
- Add axis titles. Click the chart, then click the plus sign that appears at its top-right corner (Chart Elements). Tick "Axis Titles" and type the names of your X and Y variables into the placeholder boxes.
- Add a chart title. In the same Chart Elements menu, tick "Chart Title" and type a short description such as "Score vs. Hours Studied".
- Format the axes if needed. Right-click an axis and choose "Format Axis". In the pane that opens you can set the minimum and maximum bounds, the major unit (the gap between gridlines), and whether the axis crosses at zero. This is useful when all your points are clustered in one corner.
- Add a trendline (optional). Right-click any data point and choose "Add Trendline". Pick Linear for a straight-line fit, or another type if your data calls for it. Tick "Display Equation on chart" if you want the formula shown.
- Add data labels (optional). Right-click a point and choose "Add Data Labels". By default Excel shows the Y value; to show the X value or a custom label, right-click the label and choose "Format Data Labels" and change what is displayed.
- Move and resize the chart. Drag the chart by its border to reposition it, or drag a corner handle to resize. To put it on its own sheet, right-click the chart and choose "Move Chart" > "New sheet".
Common Mistakes
- Plotting the columns the wrong way round. Excel always treats the left column as X and the right as Y. If your chart is transposed, swap the column order in the sheet and re-select the data rather than trying to fix it in the chart.
- Leaving text in the numeric columns. A single text value, a stray space, or a number stored as text will drop that point from the plot or shift the whole series. Check that the cells are formatted as Number or General, not Text.
- Using a Line chart instead of a Scatter chart. A Line chart treats the X values as evenly spaced categories, which distorts the shape of the data. If your X values are unevenly spaced, you need Scatter.
- Including headers as data. If Excel plots a point at zero for your header row, you selected the headers without telling Excel they are headers. Use the "Select Data" dialog (right-click the chart > Select Data) and set the series name and range correctly.
- Forgetting that blank cells break lines. With a line-style scatter chart, blank cells create gaps. Either fill the gaps or accept the break.
Tips
- Sort your data by X value before charting if you use a line-style scatter. The line connects points in row order, so unsorted data produces a zig-zag.
- Use "Select Data" (right-click the chart) to add a second series, for example two groups plotted on the same axes with different marker colours.
- Right-click a data point and choose "Format Data Series" to change marker size, shape, and fill. Smaller markers work better when you have many points.
- If you have thousands of points, switch the marker to a small dot and remove the outline; the chart stays readable and renders faster.
- Copy the chart and paste it into Word or PowerPoint as a picture if you need a fixed version that will not change when the spreadsheet does.
- Use a scatter chart with a trendline to show correlation, but remember that correlation is not causation; the trendline describes the data, it does not prove a cause.
Troubleshooting
- The chart is empty or shows only one point. Check that both columns contain numbers and that the selected range covers all rows. Look for cells formatted as Text.
- The axes are reversed. Swap the column order in the sheet, or use Select Data and edit the X and Y ranges for the series.
- Points are bunched in a corner. Right-click the axis, choose Format Axis, and set the minimum and maximum bounds manually to the range of your data.
- The trendline does not appear. Make sure you right-clicked a data point, not the chart background. If the option is greyed out, the series may contain text or errors.
- Labels overlap. Reduce the number of labels, or right-click the labels and choose Format Data Labels to change position and font size.
- The chart will not update when data changes. Confirm the chart's source range still covers the cells; if you added rows below the original range, use Select Data to extend it.
Frequently Asked Questions
What is the difference between an XY chart and a line chart?
An XY (scatter) chart plots numeric X and Y values against each other, so the spacing between points reflects the actual X values. A line chart treats the X axis as evenly spaced categories, which is fine for time series with regular intervals but misleading for unevenly spaced numeric data.
Can I plot more than one series on an XY chart?
Yes. Right-click the chart and choose Select Data, then click Add and specify the X and Y ranges for the new series. Each series gets its own marker style and colour.
How do I swap the X and Y axes?
The simplest fix is to swap the two columns in the worksheet and re-select the data. Alternatively, use Select Data and edit the X and Y ranges for each series.
Why does my chart show zero for some points?
Blank cells are treated as zero in some chart types. Check the source range for empty cells and either fill them or remove those rows from the selection.
Can I add error bars to an XY chart?
Yes. Click the chart, open Chart Elements (the plus sign), tick Error Bars, and choose the type and amount. This is useful when your measurements have a known uncertainty.
Does an XY chart work in Excel for the web?
Yes, the basic scatter chart types and trendlines are available in Excel for the web. Some advanced formatting options are only in the desktop app.