How to Make an XY Graph in Excel (Scatter Plot)
In this article
To make an XY graph in Excel, put your x values in one column and your y values in the column next to it, select both columns including the headers, then choose Insert > Scatter (the scatter chart icon in the Charts group) and pick the style that shows markers only or markers with connecting lines. Excel calls this chart type Scatter, not "XY graph" or "XY scatter" in the ribbon, which is why many people cannot find it. A scatter chart treats the two columns as paired numbers, plotting each row as a single point at position (x, y), so the order of the rows does not change the shape of the graph.
What You'll Need
- Excel for Windows, Mac, in a browser (Microsoft 365), or the mobile app. Steps below are written for desktop; the mobile versions can create a scatter chart but offer fewer formatting options.
- Two columns of numeric data: one for the x axis (the independent variable) and one for the y axis (the dependent variable).
- One row per data point. Each row's x value and y value must be on the same row, or the graph will pair the wrong numbers.
- Clean numbers: no units typed into the cells ("12 kg" is text), no stray spaces, and no blank rows inside the data range.
Note that Excel menu labels and icon positions can differ slightly by version, platform and language, so if a name looks different on your screen, look for the closest match in the same tab.
Step-by-Step
- Lay out the data. In an empty area, type a header for x in cell A1 (for example "Time") and a header for y in B1 (for example "Temperature"). Type the x values down column A and the matching y values down column B, starting in row 2. Do not merge cells and do not leave blank rows.
- Check the number formats. Select the data and confirm Excel is treating it as numbers, not text. Numbers usually align to the right of a cell; text aligns left. If your numbers are left-aligned, select the cells, use Data > Text to Columns (or the warning icon that appears) to convert them, or retype them without units or leading apostrophes.
- Select the data. Click the top-left header cell (A1), hold Shift, and click the bottom-right value cell in column B. Include the headers, because Excel uses them to label the axes. A quick alternative is to click any single cell inside the data and press Ctrl+A (Windows) or Command+A (Mac).
- Insert the chart. Go to the Insert tab and, in the Charts group, click the Scatter icon. Choose "Scatter" for markers only, or "Scatter with Smooth Lines and Markers" if you want a trend line connecting the points. For scientific or measured data, markers-only is usually the honest choice.
- Place the chart. Excel drops the chart on the same sheet, overlapping your data. Drag it by its border to an empty area, or grab a corner handle to resize it. For a full-page graph, right-click the chart and choose Move Chart > New sheet to send it to its own tab.
- Label the axes. Click the chart, then click the plus (+) button at its top-right corner (Chart Elements) and tick Axis Titles. Type a descriptive x-axis title and y-axis title, including units. The plus button is the fastest route to titles, gridlines, legend and data labels on current desktop versions.
- Fix the axis scale if needed. Right-click the x axis and choose Format Axis. Set the Minimum and Maximum bounds to sensible values (starting at zero when that makes sense), and adjust Major Units to control the tick spacing. Repeat for the y axis. This matters most when your data sits in a narrow range, because Excel's automatic scaling can exaggerate small differences.
- Clean up the appearance. Add a chart title by clicking the placeholder text. Turn the legend off if you plotted only one series, since it adds nothing. Format markers under Format Data Series to change their shape, size and fill so they stand out against the gridlines.
- Add a trendline (optional). Right-click any data point, choose Add Trendline, and pick Linear or another fit. Tick "Display Equation on chart" and "Display R-squared value on chart" if you want to show how well the line fits. Trendlines only make sense on scatter charts, which is one reason scatter is the right chart type for paired measurements.
- Save and verify. Click a couple of points and check the tooltip or the formula bar shows the row you expect. Save the workbook. If you later add rows to the data range, drag the coloured range outline to include them, or the new points will not appear.
Common Mistakes
- Using a Line chart instead of Scatter. A Line chart treats the x values as evenly spaced labels, so unevenly spaced x values are plotted at equal distances and the shape of the data is distorted. Only Scatter plots true numeric positions.
- Putting x and y in the wrong columns. Excel plots the first selected column as x and the second as y when the chart is created this way. If the graph is rotated, use Select Data and swap the series, or simply rearrange the columns.
- Numbers stored as text. Strings, units typed into cells, or values preceded by an apostrophe are ignored or plotted as zero, producing a cluster at the origin.
- Blank rows and totals inside the range. A total row at the bottom, or a gap in the middle, becomes an extra point at (0,0) or breaks the series. Keep totals out of the plotted range.
- Leaving out headers, then wondering why the axes say "Series 1". Selecting the header row lets Excel name the series and axes automatically.
- Comparing two datasets with different ranges on one axis. If one series ranges 0-10 and another 0-10,000, the first flattens to a straight line. Plot them separately, or use a secondary axis while making clear the scales differ.
Tips
- Sort the rows by x value before charting. The points look the same either way, but a sorted sheet makes it much easier to spot gaps and duplicates.
- Use markers with smooth lines only when the data is genuinely continuous. Lines between unrelated measurements imply a relationship that may not exist.
- Make a clean copy of your data for charting (values only), so live formulas recalculating during edits do not shift the chart unexpectedly.
- If you will rebuild the same chart often, save it as a chart template once you have formatted it, then apply it to new data with Change Chart Type > Templates.
- Add data labels for small datasets so readers can read exact values without hovering; skip them for dense data because they overlap.
- Keep the marker colour the same across charts that will sit side by side, so the series stay recognisable.
Troubleshooting
All points sit in one corner. One or two outliers are stretching the axis. Set the axis Maximum bound manually, or filter out the outliers after checking they are genuine values, not typos.
The chart is empty or shows a flat line at zero. The data is almost certainly text. Check the cell alignment and the number format, and convert with Text to Columns.
The chart stops at old data when you add rows. Update the source range: click the chart, go to Chart Design > Select Data, and edit the range, or drag the range outline on the sheet.
The points are in the wrong order or the line looks like spaghetti. You plotted a Line chart or the rows are unsorted. Change the chart type to Scatter or sort by x.
Axis numbers show as dates. Excel detected the x column as dates (Date axis is on). Right-click the axis, choose Format Axis, and set Axis Type to Text or switch off the automatic date detection for scatter.
The chart looks fine on your screen but odd on another machine. Fonts, screen resolution and Excel versions differ; print or export to PDF to check it looks right before sharing.
Frequently Asked Questions
What is the difference between an XY graph and a line chart in Excel?
An XY (scatter) chart plots both axes as numbers, so an x value of 1, 5 and 20 will be spaced according to their real distance. A line chart plots the x axis as evenly spaced categories and ignores the actual numeric gaps, which misrepresents unevenly spaced data.
Can I make an XY graph with more than two variables?
Only two variables can be plotted as x and y positions. A colour or marker-size encoding is not a standard Excel scatter feature, so the usual approach is one chart per pair, or several series sharing the same axes to compare groups.
Why does my scatter chart show a point at zero, zero?
Excel plots blank cells and text cells as zeros in a scatter series. Remove blank rows inside the range, exclude totals, and convert text-style numbers to real numbers.
Can I label individual points with names?
On current desktop versions you can right-click a point, choose Add Data Label, then edit that label's text, or use Format Data Labels and select Value From Cells to pull labels from a third column. Mobile apps have fewer options here.
Does the order of rows matter in a scatter chart?
No. Each row becomes one point at its own x and y coordinates, so swapping rows changes nothing visually. Sorting by x only helps you read the sheet.
Can I connect the points with a line?
Yes, choose a scatter style that includes lines, or right-click the series and add a trendline. A trendline shows a fitted relationship; connecting lines show the order the points were recorded.