How to Make a Line Chart in Excel
By ExcelReady TeamUpdated 6 min read
The short answer
To make a line chart in Excel, put dates or months in the first column and values in the next, with headers in row 1. Select the data, go to Insert > Insert Line or Area Chart, and pick Line or Line with Markers. Add a chart title and axis titles, and use one line per series to compare trends over time.
Key takeaways
- Line charts show how values change over time. Use a column or bar chart to compare separate categories.
- Put the time periods in the first column and one column per line, with a header on each.
- If your data is a list of transactions, total it by month with SUMIFS or a PivotTable first.
- Years typed as numbers can turn into an extra line. Leave the top-left header cell empty to fix it.
- Format the data as a table so new rows appear in the chart automatically.
On this page+
A line chart in Excel shows how a value changes over time: sales by month, visitors by week, costs by year. You lay out the dates in one column and the values beside them, then insert the chart from the Insert tab in a few clicks. This guide covers the steps, adding a second line, fixing the common date and gap problems, and preparing monthly totals so the chart tells a clear story.
When to use a line chart#
Use a line chart when the horizontal axis is time and you want to show the trend. The line joins each point to the next, which tells the reader the values are connected.
| Your question | Best chart |
|---|---|
| How did sales change month by month? | Line |
| Are we above or below target over the year? | Line with two series |
| Which region sold the most? | Bar or column |
| What share does each product have? | Pie, for a few slices only |
Don't use a line chart for categories that have no order, such as regions or product names. A line between "North" and "South" suggests a trend that doesn't exist. The guide to making charts in Excel compares all the main chart types.
How to set up the data for a line chart#
A line chart needs the time periods in the first column and one column of values for each line. Put a header on every column, because Excel uses the headers as the legend names.
| A | B | C | |
|---|---|---|---|
| 1 | Month | Sales | Target |
| 2 | Jan | 800 | 1,000 |
| 3 | Feb | 970 | 1,000 |
| 4 | Mar | 1,440 | 1,200 |
| 5 | Apr | 1,210 | 1,200 |
| 6 | May | 1,580 | 1,500 |
| 7 | Jun | 1,720 | 1,500 |
Keep the periods in order, from oldest to newest, with no blank rows or subtotal rows in the middle. If you have real dates, such as 1 Jan 2026, keep them as dates: Excel can then build a proper date axis.
How to make a line chart step by step#
Once the data is in place, inserting the chart takes four steps:
- Select the data, including the headers: A1:C7.
- Go to Insert and, in the Charts group, click Insert Line or Area Chart.
- Choose Line or Line with Markers. Markers show each data point as a dot, which helps when there are only a few points.
- Click the chart title and type a clear one, such as "Monthly sales vs target, Jan–Jun 2026".
Excel draws two lines, Sales and Target, with the months along the bottom. On Windows, Alt+F1 inserts a default chart next to the data. It's usually a column chart, so switch it with Chart Design > Change Chart Type > Line.
Add axis titles and data labels#
Click the chart, then the Chart Elements button (the + next to the chart) and tick Axis Titles or Data Labels. On a Mac, use Chart Design > Add Chart Element instead. Label the vertical axis with the unit, such as "Sales ($)", so nobody has to guess.
How to turn transactions into monthly totals#
Most real data is a list of transactions, not a tidy monthly table. Chart a raw list and you get a jagged line with one point per sale. Total the values by period first.
Say column A holds dates and column B holds sales. Put the first day of each month in column D and use the SUMIFS function to add up everything in that month:
=SUMIFS($B$2:$B$8,$A$2:$A$8,">="&D2,$A$2:$A$8,"<"&EDATE(D2,1))The first condition keeps dates on or after the start of the month. The second keeps dates before the start of the next month, which EDATE works out. With the sales from the exercise on this page, February 2026 comes to 970 (510 + 460). The dates in criteria lesson practises this pattern, and the guide to summing by month shows more options.
A PivotTable does the same job without formulas: put the date in Rows, group it by Months, and put Sales in Values. Then insert a PivotChart. The pivot-style summary lesson builds this kind of summary with formulas so you understand what the PivotTable is doing.
How to fix common line chart problems#
Most line chart problems come from the data layout. Here are the usual fixes:
| Problem | Cause | Fix |
|---|---|---|
| An extra flat line along the bottom | Years in column A are numbers, so Excel plots them as a series | Delete the header in A1 and insert the chart again, or edit the axis labels in Select Data |
| Points are unevenly spaced | Excel uses a date axis and spaces points by real time | Format Axis > Axis Options > Axis Type: Text axis |
| The line drops to zero | A formula returns "" or 0 for a month with no data | Return NA() instead; line charts skip #N/A |
| Gaps in the line | Empty cells in the data | Right-click Select Data > Hidden and Empty Cells and choose Connect data points with line |
| Months in the wrong order | Data isn't sorted oldest to newest | Sort the data by date |
Two very different scales#
If one line is in thousands and another is a percentage, the smaller one looks flat. Right-click the smaller series, choose Format Data Series, and select Secondary Axis. Label both axes clearly so readers know which scale goes with which line.
Add a trendline or a sparkline#
A trendline is a straight line Excel fits through the points to show the general direction. Click the chart, open Chart Elements (Mac: Add Chart Element), and tick Trendline. Linear is the default and works for most business data. Treat it as a guide, not a forecast.
A sparkline is a tiny line chart inside one cell, useful in tables and dashboards. Select an empty cell, go to Insert > Sparklines > Line, and pick the data range. Each row of a table can have its own small trend line.
Keep the chart up to date#
Charts follow their source range, so a new month added below the data may be left out. Format the data as a table first (Ctrl+T; Mac: ⌘T). When you add a row, the table grows and the chart includes the new point automatically.
If the chart feeds a report, you can place it next to totals and KPIs. The guide to building a sales dashboard in Excel shows how line charts fit with other summaries on one page.
Practise it#
A good line chart starts with good monthly totals. Practise date-based criteria in a live spreadsheet: you total values between two dates and the sheet checks your formula instantly. Then build a full summary table in the pivot-style summary lesson, and chart it in Excel.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Before you chart monthly sales, you need monthly totals. Click E2 and use SUMIFS to total the sales in B2:B8 for February 2026: dates on or after 1 Feb 2026 and before 1 Mar 2026.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Sales | Total | ||||
| 2 | Feb 2026 | |||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | ||||||
| 8 | ||||||
| 9 | ||||||
| 10 | ||||||
| 11 |
Tip: Check the date column twice: ">="&DATE(2026,2,1) and "<"&DATE(2026,3,1).
Practise this in a lesson
Frequently asked questions
How do I make a line chart in Excel with two lines?
Put each series in its own column next to the dates, such as Sales and Target, and select all the columns before you insert the chart. Excel draws one line per column.
How do I make a line graph with dates in Excel?
Put real dates in the first column and insert a line chart. Excel uses a date axis and spaces the points by time. To space them evenly instead, set the axis type to Text axis in Format Axis.
Why does my line chart show an extra line along the bottom?
Excel has treated your years or numbers in the first column as a data series. Delete the header in the top-left cell and insert the chart again, or edit the axis labels in Select Data.
How do I skip blank values in an Excel line chart?
Right-click the chart, choose Select Data, then Hidden and Empty Cells, and pick Gaps or Connect data points with line. Formulas that return "" plot as zero, so return NA() instead.
When should I use a line chart instead of a bar chart?
Use a line chart for a trend over time, such as monthly sales. Use a bar or column chart to compare separate categories, such as sales by region.