How to Make a Line Graph in Excel (and Fix the Axis)
How to make a line graph in Excel in three clicks, then fix what breaks it: the date axis, gaps in the data and a second series on another scale.

A line graph is the chart for showing how something changes over time, and Excel will draw one in three clicks. The clicks are the easy part. What costs the other five minutes is the horizontal axis, the gaps where data is missing, and the second series that lives on a completely different scale. Here is how to make a line graph in Excel, in two halves: the clicks, and the fixes.
How to make a line graph in Excel
To make a line graph in Excel, put the time periods in the first column and one column of numbers per series beside it, select the whole block with its headers, then choose Insert, Charts, Line (or Line with Markers). Excel draws the chart at once. Then set the horizontal axis to a date axis and remove the smoothing.
Set the data up first
Time goes down the first column, one row per period, and each series gets its own column. The example in this guide is annual consumer price inflation for three economies, from the World Bank:
| Year | United States | United Kingdom | Germany |
|---|---|---|---|
| 2014 | 1.6 | 1.5 | 0.9 |
| 2015 | 0.1 | 0.4 | 0.5 |
| 2016 | 1.3 | 1.0 | 0.5 |
Three things go wrong here before you have drawn anything:
Years stored as numbers become a series. If the first column holds 2014, 2015 and so on as plain numbers, Excel plots them as a fourth line. Either leave the top-left header cell empty, or store the years as text, and Excel will treat the column as the axis.
Dates must be real dates. Type 2026-01 and Excel may store text. Select the column and check the alignment: dates right-align, text left-aligns. If they are text, use Data → Text to Columns → Finish, which forces Excel to re-parse the column, then apply a date format.
Do not skip missing periods. If a year has no data, keep its row with an empty cell instead of jumping from one year to the next. Skipping the row makes the line squeeze the gap and quietly changes the slope the reader sees.
Insert the line graph
- Select the whole block, headers included.
- Go to Insert → Charts and click the line chart icon.
- Choose Line or Line with Markers.
Use markers when you have fewer than about twenty points, because they show the reader where the real observations are instead of implying you measured continuously. Above twenty, they turn into clutter.
Avoid smoothed lines. A smoothed line invents values between your data points, and on volatile data it draws peaks that never happened. If your chart came out curved, right-click the line → Format Data Series → untick Smoothed line.
Here is the same data as a finished, interactive line chart. It is built from exactly those four columns, with the lines labelled directly instead of through a legend:
All three economies sit between roughly 0% and 3% until 2020, then spike in 2022: 8.0% for the United States, 7.9% for the United Kingdom and 6.9% for Germany. In 2023 the United States falls fastest, to 4.1%, while the United Kingdom stays at 6.8%. A line graph is what makes that divergence visible.
Fix the horizontal axis
This is where most Excel line graphs go wrong. Excel treats the horizontal axis as either a date axis, spaced by actual elapsed time, or a text axis, where every label is evenly spaced whatever the gap. If your observations are irregular, such as daily for a month and then monthly, a text axis flattens the busy stretch and stretches the quiet one.
Right-click the horizontal axis → Format Axis → Axis Type, and choose:
- Date axis for anything measured against real time. This is almost always the right answer, and it is only offered when the first column holds real dates.
- Text axis when the labels are ordered categories that are not time at all, such as survey waves.
If the labels are crowded, set Units → Major on a date axis (or Interval between labels on a text axis) to a fixed number instead of letting Excel rotate them diagonally.
Handle the gaps
By default, a blank cell breaks the line in two. Sometimes that is exactly right, because an honest gap says "we have no data here". Sometimes it makes a two-year series look like six unrelated fragments.
Select the chart, then Chart Design → Select Data → Hidden and Empty Cells. There are three options:
| Option | What the line does | When to use it |
|---|---|---|
| Gaps | Breaks | The honest default |
| Zero | Drops to zero | Almost never: it invents a value of nought |
| Connect data points with line | Bridges the gap | One missing point in a long series, with a footnote |
Two series on different scales
If one series is in the tens of thousands and another in the hundreds, they cannot share an axis: the smaller one flattens into the baseline. Excel's answer is a secondary axis. Right-click the smaller series → Format Data Series → Series Options → Secondary Axis.
It works, and it is also the easiest way to mislead with a line chart, because you can slide either axis until two unrelated lines appear to move together. The axis trick that made a pandemic look calm shows how far that can go. If your point is that two things are related, index both series to 100 at the first period instead: in a new column enter =B2/B$2*100 and fill down. Both lines then share one axis and start from the same place. If you keep the secondary axis, label both axes and never let a reader infer cause from two lines that happen to cross.
Tidy-up worth doing
- Delete the chart border and the plot-area fill. They add nothing.
- Label the lines directly instead of using a legend. Right-click the last point of a series → Add Data Label → Format Data Labels → tick Series Name.
- Set the line width to about 2.25 to 3 pt, so the lines survive a projected slide.
- Keep the horizontal gridlines and drop the vertical ones. On a line chart the vertical gridlines are noise.
- Think about the baseline. A line chart tolerates a non-zero start better than a bar chart does, because position rather than length carries the value, but if you truncate the axis, say so.
Microsoft's own create a chart from start to finish guide covers the rest of the ribbon, and our guide to the types of charts in Excel and when each one works helps you decide whether a line is the right chart in the first place.
Common problems
All the lines are flat at the bottom. One series is orders of magnitude larger. Use a secondary axis, index the series, or split into two charts.
The line has only one point. Excel charted a single row. Check that your selection includes every data row and that no filter is hiding any.
Dates show as five-digit numbers. The axis lost its date formatting. Right-click the axis → Format Axis → Number and pick a date format.
New rows do not appear. Convert the source range to a table with Ctrl + T before inserting the chart, and the series grows as you add rows.
When to build it somewhere else
Excel is fine for looking at a trend yourself. It gets uncomfortable when the chart has to be published: a pasted image loses the hover values, the styling is Office's rather than yours, and there is no clean way to embed a live version in a page.
If the line graph is headed for a website or a report, the PlotSet line chart maker takes the same columns, which you can save as a CSV from Excel or paste in directly, and gives you an interactive chart with hover values, your own fonts and colours, an embed link, and SVG, PNG and JPG export. Free to start. The how to make a line chart guide walks through it step by step, and the line and area chart templates show the other styles. If you want the area under the line filled in, see the area chart maker.
Quick reference
| Task | How |
|---|---|
| Insert the default chart | Select the data, Alt + F1 |
| Date axis or text axis | Right-click the horizontal axis → Format Axis → Axis Type |
| Remove smoothing | Right-click the line → Format Data Series → untick Smoothed line |
| Control gap behaviour | Select Data → Hidden and Empty Cells |
| Add a secondary axis | Right-click the series → Format Data Series → Secondary Axis |
| Label lines directly | Right-click the last point → Add Data Label → Series Name |
| Extend automatically as rows are added | Convert the range to a table (Ctrl + T) first |
Frequently asked questions
How do I make a line graph in Excel with two lines?
Put the time periods in the first column and each series in its own column after it, select the whole block with its headers, then choose Insert → Charts → Line. Each extra column becomes another line, and the headers become the series names.
How do I make a line graph in Excel with dates on the x-axis?
Make sure the first column holds real dates, not text, then insert the line chart and set the horizontal axis to Date axis under Format Axis → Axis Type. Excel then spaces the points by elapsed time instead of evenly.
Why is my Excel line graph showing the years as a line?
Excel read the year column as numbers and plotted it as a series. Clear the top-left header cell, or store the years as text, and the column becomes the horizontal axis.
How do I add a second axis to a line graph in Excel?
Right-click the series that is on a different scale, choose Format Data Series, and tick Secondary Axis. Label both axes, because two scales make it easy to suggest a relationship that is not there.
How do I make an interactive line graph from Excel data?
An Excel chart pasted into a page is a static picture. Save the columns as a CSV and upload them to a chart tool such as the PlotSet line chart maker, which gives you hover values and an embed link.


