The basic steps to create a line graph

A line graph in Excel starts with your data in two columns: one for the x-axis labels (usually time or categories) and one or more columns for the values you want to plot. Select all the data including headers, click the Insert tab at the top, find the Charts group, and choose Line. Excel will create a basic graph; you can then change the title, axis labels, and appearance using the tools that appear.

The whole process takes about two minutes once your data is organized. If your data is scattered across the sheet or has gaps, the graph will look wrong, so the first step is always to make sure your numbers are in clean columns with nothing in between.

Key Takeaways

  • Organize your data in two or more columns with headers before you start — one column for labels (dates, months, categories) and one or more for the numbers you want to show.
  • Select all your data including the header row, then go to Insert > Charts > Line and pick the line chart style that matches what you want to show.
  • Excel creates the graph automatically, but you should add a title and label the axes so anyone reading it understands what the numbers mean.
  • You can change colors, add data labels, and adjust the scale by right-clicking on different parts of the graph and choosing format options.

Getting your data ready

Line graphs work best when your data sits in adjacent columns with no blank rows or extra text in the middle. Put your category or time labels in the first column — these become the x-axis. Put the numbers you want to plot in the columns to the right. Include a header row at the top that names each column.

For example, if you are tracking monthly sales, your first column might be labeled "Month" with entries like January, February, March. The next column might be "Sales" with the dollar amounts. If you are comparing two products, add a third column labeled "Product B" with its own numbers. Excel reads the headers to label your axes and legend automatically.

Delete any blank rows between your data. If you have notes or extra information below your data, move it to a different part of the sheet. Excel will include anything in your selection in the graph, which usually makes it look wrong.

Selecting the data and inserting the chart

Click on the first cell of your data (usually the header in the top-left corner of your table). Hold down the mouse button and drag to the last cell that contains data. You can also click the first cell, then hold Shift and click the last cell. The entire range should be highlighted in blue.

Go to the Insert tab at the top of the ribbon. Look for the Charts group — it usually shows small chart icons. Click the small arrow next to the chart icons to see all options, or click directly on the line chart icon if you see one. A menu will appear showing different line chart styles: basic lines, lines with markers (dots), stacked lines, and 3D lines. Choose the style that fits what you want to show. Excel will insert the chart into your sheet right away.

Adding titles and labels so the graph makes sense

A graph without labels is confusing. Click on the chart to select it (you will see a border around it). A small plus sign will appear in the top-right corner. Click it and check the boxes for "Chart Title" and "Axis Titles." A title box will appear at the top of the chart and label boxes will appear on the axes.

Click the chart title and type a name that describes what the graph shows — for example, "Monthly Sales 2024" or "Temperature by Week." Click the axis titles and name them too: the horizontal axis might be "Month" and the vertical axis might be "Sales ($)" or "Temperature (°F)." These labels tell anyone looking at the graph what the numbers represent.

If you do not want a title or label, click it and press Delete. You can move titles by clicking and dragging them to a new spot on the chart.

Changing colors and appearance

Right-click on the line itself (not the background) to change its color or thickness. A menu will appear with options like "Format Data Series." Click that option and a panel will open on the right side of your screen. You can change the line color, make it thicker or thinner, and add markers (small dots) at each data point.

To change the background color or the grid lines, right-click on the gray area behind the graph. To change the numbers on the axes, right-click on the axis itself. Most formatting options appear when you right-click the part you want to change.

If you make a change you do not like, press Ctrl+Z (or Cmd+Z on a Mac) to undo it. You can undo multiple steps this way.

Moving and resizing the chart

Click on the chart border to select it. A set of small squares will appear around the edges. Drag the chart to move it to a different spot on your sheet. Drag the small squares at the corners or edges to make it bigger or smaller. The chart will stay connected to your data, so if you change a number in your original table, the graph updates automatically.

If you want the chart on a separate sheet by itself, right-click the chart and choose "Move Chart." You can create a new sheet just for the graph or move it to an existing sheet.

Common mistakes and how to fix them

If your graph looks wrong — lines in the wrong place, missing data, or labels that do not make sense — the problem is usually in how the data was selected. Click the chart, then look for a small icon that looks like a table with colored squares (the data range selector). Click it and reselect your data, making sure you include all the numbers and headers you want to show.

If one line is much higher than the others and squashes the rest flat, the scale of your axes might be the problem. Right-click the vertical axis (the one with numbers) and choose "Format Axis." You can set the minimum and maximum values manually so all your data is visible and readable.

If your category labels (the x-axis) are tilted or overlapping, right-click them and choose "Format Axis." Under "Text Options," you can rotate the text or change the angle so they are easier to read.

Frequently Asked Questions

Can I make a line graph from data in different sheets?

Yes, but it is easier if you copy the data into one sheet first. If you want to link to data in another sheet without copying, you can, but the process is more complex. For most purposes, copying the data you need into one place and making the graph there is faster.

What if I have too many lines and the graph looks cluttered?

Remove lines by clicking the chart, then right-clicking the line you do not want and choosing "Delete." You can also go back to your original data and hide the columns you do not want to show — select the column, right-click, and choose "Hide." The graph will update automatically.

How do I add a line for a new data series after I have already made the graph?

Add the new data to your original table in a new column with a header. Click the chart, then click the data range selector icon (the small table icon). Expand your selection to include the new column. The new line will appear on the graph automatically.

Can I change a line graph to a different type of chart?

Yes. Click the chart, go to the Insert tab, and click "Change Chart Type." Pick a new style — bar, column, area, or any other type. Your data stays the same; only the way it is displayed changes.

Why does Excel keep changing my axis numbers to scientific notation?

This happens when your numbers are very large or very small. Right-click the axis with the strange numbers, choose "Format Axis," and under "Number," change the format from "Scientific" to "Number." Set the decimal places to what you need.