How to create a line graph in Excel
A line graph in Excel shows how values change over time or across categories by connecting data points with lines. To create one, you enter your data in columns or rows, select that data, go to the Insert tab, click Chart, choose Line, and pick your preferred style. Excel then builds the graph automatically, and you can adjust titles, labels, and formatting from there.
The process takes about two minutes once your data is ready. The hardest part is usually organizing your data correctly before you start — Excel needs to know which column holds your labels (like months or dates) and which holds your numbers.
Key Takeaways
- Your data must be organized in columns or rows, with labels in one column and numbers in another, before you insert a chart.
- Select your data range, click Insert > Chart, choose Line, and Excel creates the graph immediately.
- You can edit the title, axis labels, and legend by double-clicking the chart and using the Chart Design and Format tabs.
- A line graph works best for showing trends over time, but you can also use it to compare multiple series (like sales across different regions).
Organizing your data before you start
Excel reads data in a specific way. Put your labels (the names of months, years, regions, or whatever you are measuring) in the first column or row. Put your numbers in the columns or rows next to it. If you have multiple data series — for example, sales from January through December for both 2023 and 2024 — put each series in its own column.
Here is a simple example: Column A holds months (January, February, March), Column B holds sales numbers (5000, 7200, 6800). That is all Excel needs. If you add Column C with a second year of sales, Excel will automatically draw two lines on the same graph.
Do not leave blank rows or columns in the middle of your data. Excel will stop reading when it hits an empty cell. If your data has headers (like "Month" and "Sales"), include them — Excel recognizes headers and uses them as labels.
Selecting your data and inserting the chart
Click on the first cell of your data (including the header if you have one) and drag to the last cell that contains data. You can also click the first cell and then hold Shift and click the last cell. The selected range should be highlighted in blue.
Once your data is selected, go to the Insert tab at the top of the ribbon. Click the Chart button (it looks like a small bar graph). A dropdown menu appears with different chart types. Click Line to see the line graph options.
Excel shows you several line graph styles: lines only, lines with dots, stacked lines, and 3D lines. Choose the one you want — the first option (lines with dots) is the most common. Click it, and Excel inserts the chart into your spreadsheet immediately, usually positioned over your data.
Adding and editing titles and labels
When the chart first appears, it has a generic title like "Chart Title" and may not have axis labels. Click on the chart to select it (you will see a border around it). The Chart Design and Format tabs appear in the ribbon.
To add a title, click the Chart Design tab and look for Chart Title. Click it and choose where you want the title to appear (usually "Above Chart"). Type your title in the text box that appears. To add axis labels, click Chart Design, find Axis Titles, and add titles for both the horizontal (X) and vertical (Y) axes.
If you want to edit the legend (the box that shows what each line represents), right-click the legend and choose Format Legend. You can move it, resize it, or remove it entirely. Most readers expect the legend on the right side or bottom of the chart.
Adjusting the appearance of your graph
With the chart selected, the Format tab lets you change colors, line thickness, and fonts. Click the chart itself to select it, then use the Shape Outline option to change line colors or thickness. Right-click any line on the graph to format just that line.
If your numbers are very large or very small, the Y-axis (vertical) might show values in scientific notation or with many decimal places. Right-click the Y-axis numbers and choose Format Axis. Under Number, you can set how many decimal places to show or change the format entirely.
To move the chart, click it and drag it to a new location. To resize it, click it and drag one of the corner handles. Most people move charts below their data or to a new sheet so the data and graph do not overlap.
Handling multiple data series on one graph
If your data has multiple columns of numbers, Excel automatically draws a separate line for each one. Each line gets a different color, and the legend shows which line represents which series. This is useful for comparing trends — for example, showing how revenue, costs, and profit changed month by month.
If you want to add a new data series after the chart is created, right-click the chart and choose Select Data. Click Add, then specify the range for your new series. If you want to remove a series, select it in the Select Data dialog and click Remove.
Saving and sharing your graph
Your chart is part of the Excel file, so saving the file saves the chart. If you want to use the chart in another program (like Word or PowerPoint), right-click it and choose Copy. You can then paste it into another document. The chart will be a picture, not a live Excel object, so changes to the original data will not update the pasted version.
If you want to export just the chart as an image, right-click it, choose Save as Picture, and pick a format like PNG or JPG. This creates a separate image file you can share or insert elsewhere.
Frequently Asked Questions
Why does my line graph look wrong after I insert it?
The most common cause is that Excel read your data in the wrong direction. If your labels are in a row instead of a column, or if you have blank rows in your data, Excel may have switched which axis shows what. Right-click the chart, choose Select Data, and check that the labels are listed under "Horizontal (Category) Axis Labels" and your numbers are listed under "Series".
Can I change the line style from solid to dashed?
Yes. Right-click the line on the graph, choose Format Data Series, and look for Line Style. You can change it to dashed, dotted, or other patterns. You can also adjust the thickness here.
How do I show the actual numbers on each data point?
Right-click the line, choose Format Data Series, and look for Data Labels. Click the checkbox next to Data Labels and choose where you want the numbers to appear (above, below, or on the points). This is useful for small charts with few data points, but can make large charts look cluttered.
What if my data includes dates and they do not show correctly on the X-axis?
Excel sometimes treats dates as text instead of numbers. Right-click the X-axis, choose Format Axis, and under Axis Type, make sure "Date Axis" is selected. If your dates are formatted as text (like "01/15/2024" in quotes), you may need to reformat them as actual dates in your data before creating the chart.
Can I create a line graph from data in different sheets?
Yes, but it is easier to copy all your data to one sheet first. If you want to reference data from multiple sheets, right-click the chart, choose Select Data, and manually enter the range for each series using the format SheetName!CellRange (for example, Sales!A1:A12).