Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Make an X Y Graph in Excel: Step-by-Step

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To make an X Y graph in Excel, put your X values in one column and your Y values in the next, select both columns, then insert a Scatter chart. That is the short version. The rest of this guide covers the exact clicks, how to get a clean result, and what to do when Excel plots the wrong thing.

What You'll Need

  • Excel for Windows, Mac, or the web (the steps below are for the desktop app; the web version has the same Scatter chart option but fewer formatting tools).
  • Two columns of numbers: one for X (the independent variable) and one for Y (the dependent variable).
  • Optional: column headers like "Time" and "Temperature" so Excel labels the axes for you.

Step-by-Step

  1. Lay out your data in two adjacent columns. Put X values in column A and Y values in column B, starting at row 1 if you have headers or row 2 if you do not. Each row should be one data point. Do not leave blank rows in the middle of the range.
  2. Select both columns, including the headers. Click the column A header, hold Shift, and click the column B header. If you have headers, the selection should include row 1.
  3. Go to the Insert tab. In the Charts group, click the Scatter icon (it looks like dots with a line through them). Choose Scatter for dots only, or Scatter with Straight Lines if you want the points connected.
  4. Check that Excel used your X column. Click the chart, then click the plus sign (Chart Elements) that appears at the top right and tick Axis Titles. If the horizontal axis shows 1, 2, 3 instead of your X values, Excel treated column A as another series. Fix it by right-clicking the chart and choosing Select Data, then editing the series so the X values range points to your column A cells.
  5. Add axis titles. With Axis Titles ticked, click each placeholder title and type the variable name, for example "Time (s)" and "Temperature (°C)". Include units so the chart is readable without the spreadsheet.
  6. Format the axes if needed. Right-click an axis and choose Format Axis. Set the minimum and maximum bounds so the data fills the plot area, and set the major unit to a sensible interval. This is especially useful when all your Y values sit in a narrow range.
  7. Add a trendline (optional). Right-click any data point, choose Add Trendline, and pick Linear or another fit. Tick Display Equation on chart if you need the slope and intercept.
  8. Move the chart to its own sheet (optional). Right-click the chart border and choose Move Chart, then pick New sheet. This keeps the chart separate from the raw data.

Common Mistakes

  • Using a Line chart instead of a Scatter chart. A Line chart treats the X values as evenly spaced categories, so unevenly spaced measurements get distorted. Scatter is the correct type for X Y data.
  • Leaving blank cells inside the range. Excel may plot gaps or shift points. Delete or fill blank rows before charting.
  • Text in the X column. If any X cell contains text, Excel may treat the whole column as categories. Check that every X value is a number.
  • Selecting only the Y column. Excel then uses 1, 2, 3 as X. Always select both columns.
  • Headers not included. Without headers, Excel names the series "Series1" and the axes have no labels, which makes the chart harder to read.

Tips

  • Keep X values sorted ascending if you plan to add a connecting line; unsorted data produces a zigzag.
  • Use a table (Ctrl+T) for your data so the chart expands automatically when you add rows.
  • For multiple series, put each Y series in its own column next to the shared X column, then select all columns before inserting the Scatter chart.
  • Use Switch Row/Column on the Chart Design tab if Excel plots your series the wrong way round.
  • Copy the chart and use Paste Special as a picture when you need a static version for a report.

Troubleshooting

The chart shows a straight diagonal line. Excel is plotting the row number against the Y value, which means it did not use your X column. Open Select Data and set the X values range explicitly.

The X axis shows 1, 2, 3 instead of my values. Same cause: the X column was not included in the selection or was treated as a series. Re-select both columns and insert the chart again.

Points are missing. Check for blank cells, text values, or hidden rows in the range. Unhide rows and convert text-formatted numbers to real numbers using Data > Text to Columns or by retyping them.

The chart looks cramped. Drag the chart border to resize it, or reduce the font size of the axis labels. On a crowded chart, right-click the axis and adjust the major unit to show fewer tick marks.

Excel will not let you pick Scatter. Make sure you have selected a range of cells, not a single cell, and that you are on the Insert tab rather than the Home tab.

Frequently Asked Questions

What is the difference between a Scatter chart and a Line chart in Excel?

A Scatter chart plots each point using its actual X and Y values, so spacing reflects the data. A Line chart treats X values as evenly spaced categories, which distorts unevenly spaced data.

Can I make an X Y graph with more than one Y series?

Yes. Put the shared X values in one column and each Y series in its own adjacent column, select all of them, and insert a Scatter chart. Excel plots each Y column as a separate series.

How do I add axis labels with units?

Tick Axis Titles in Chart Elements, then click each title box and type the label, including units in brackets, for example "Pressure (kPa)".

Why does my chart show dates on the X axis as numbers?

Excel stores dates as serial numbers. Right-click the X axis, choose Format Axis, and set the number format to Date so the labels display as dates.

Can I make an X Y graph in Excel for the web?

Yes, the web version offers Scatter charts under Insert. Formatting options such as trendlines and detailed axis bounds are more limited than in the desktop app.