What a line graph does and when to use one

A line graph in Excel connects data points with lines to show how something changes over time. Use it when you want to display a trend — sales climbing month to month, temperature rising through the day, website traffic dipping on weekends. The horizontal axis (called the x-axis) usually shows time periods, and the vertical axis (the y-axis) shows the values you are measuring.

Line graphs work best when you have multiple data points in sequence and want to see the pattern at a glance. If you have only two or three numbers to compare, a bar chart might be clearer. If you want to show parts of a whole, use a pie chart instead. But for watching something rise, fall, or stay steady over weeks, months, or years, a line graph is the right choice.

Key Takeaways

  • Select your data including headers, then go to Insert and choose Line Chart to create a basic graph in seconds.
  • The first column should contain your time periods (dates, months, years) and the other columns should contain the numbers you want to track.
  • You can change the chart title, axis labels, and colors by right-clicking the chart and selecting Edit Chart, then using the Design and Format tabs.
  • If your data is not arranged in columns, you can still make a line graph — just select all the data you want to include, even if it is scattered across the sheet.

Arranging your data so Excel understands it

Before you create the graph, organize your data in columns. Put your time periods in the first column — these might be dates like "January 2024", "February 2024", or just "Week 1", "Week 2". Put the numbers you want to graph in the columns to the right. If you are tracking multiple things (like sales for two different products), put each one in its own column.

Include a header row at the top. The first cell might say "Month", and the cells to the right might say "Product A Sales" and "Product B Sales". Excel uses these headers to label your lines and axes, so clear headers save you work later. Do not leave blank rows or columns in the middle of your data — Excel may stop reading your data when it hits a gap.

Here is a simple example: Column A contains "January", "February", "March". Column B contains "150", "200", "180". Column C contains "120", "140", "160". When you graph this, Excel will draw one line for the numbers in Column B and another for Column C, with the months along the bottom.

Selecting your data and inserting a chart

Click on the first cell of your data (usually the header in the top-left corner) and drag to select all the data you want to include in the graph. Make sure you select the headers and all the numbers. You can also click the first cell, hold Shift, and click the last cell to select the whole range at once.

Go to the Insert tab at the top of the ribbon. Look for the Charts section — you will see icons for different chart types. Click on the Line Chart icon (it looks like a line with dots on it). Excel will show you several line chart styles: a basic line, a line with markers (dots at each point), a line with 3D effects, and others. Choose the basic line or line with markers — these are the clearest for most purposes.

Excel will insert a chart right into your spreadsheet. It may cover some of your data, but you can click and drag it to move it to an empty area. The chart is now live — if you change a number in your data, the line graph updates automatically.

Changing the title, labels, and appearance

Right-click on the chart and select Edit Chart (or double-click the chart). The ribbon will change to show chart-specific options. At the top, you will see the Design and Format tabs.

To change the title, click on the title text in the chart itself and type a new one. To add or change the axis labels, go to the Design tab and look for Chart Elements (or click the plus sign icon next to the chart). Check the boxes for Axis Titles and type in what each axis represents — for example, "Month" for the horizontal axis and "Sales in Dollars" for the vertical axis.

To change colors, go to the Format tab and look for Shape Fill or Line Color options. You can also right-click directly on a line in the chart to change just that line's color or thickness. When you are done editing, click outside the chart to exit edit mode.

Adding or removing data from your graph

If you want to add another column of data to an existing graph, select the chart, go to Design, and look for Select Data. Click that button and you will see a dialog showing which cells are included. Click Add to include a new data series, or click an existing series and click Remove to take it out.

You can also expand your data range by going back to your spreadsheet, adding new rows below your existing data, and then editing the chart's data range to include those new rows. Right-click the chart, select Edit Chart, go to Design, and choose Select Data. Change the range in the dialog to include your new data.

Fixing common problems

If your line graph looks wrong — for example, if the lines are jagged or the time periods are out of order — the problem is usually in how your data is arranged. Make sure your time periods are in the first column and are in the correct order. If you have dates, Excel works best when they are formatted as actual dates (like 1/1/2024) rather than text that looks like dates.

If one line is much higher than another and you cannot see the lower line clearly, you can add a second y-axis. Right-click the line you want to move to a second axis, select Format Data Series, and choose Secondary Axis. This gives that line its own scale on the right side of the chart.

If your chart shows a line instead of separate points, or shows points but no line, you can change the chart type. Right-click the chart, select Change Chart Type, and pick a different line style — with markers, without markers, or with markers only.

Frequently Asked Questions

Can I make a line graph from data that is not in columns?

Yes. Select all the data you want to include — it does not have to be in one neat rectangle. Hold Ctrl (or Cmd on Mac) and click multiple separate cells or ranges to select them all at once. Then insert a chart as usual. Excel will do its best to figure out what goes on each axis, though you may need to adjust it using Select Data.

How do I change which axis shows time and which shows numbers?

Right-click the chart, select Edit Chart, go to Design, and click Select Data. In the dialog, you can drag rows and columns to swap them. Or you can click Switch Row/Column to flip the entire chart around. This is useful if you set up your data horizontally instead of vertically.

What if I want to show multiple lines but they are on very different scales?

Right-click one of the lines that is hard to see, select Format Data Series, and choose Secondary Axis. That line will use a separate scale on the right side of the chart, making both lines visible. Label the secondary axis so readers understand the difference.

Can I save my line graph as a separate image file?

Right-click the chart and select Copy. Open an image editor or document, paste it, and save. Or right-click the chart in Excel, select Save as Picture, and choose a format like PNG or JPG. The chart will be saved as a standalone image file.

How do I add a trend line to show the overall direction?

Right-click one of the lines in the chart and select Add Trendline. Excel will draw a straight or curved line through your data showing the general trend. You can choose linear, exponential, or other types depending on your data. This helps readers see the big picture even if individual points bounce around.