To make a line chart in Excel, select your data range, go to the Insert tab, click the Line chart icon in the Charts group, and choose a line style. Excel plots the first column or row as categories and the remaining columns as series. The rest of this guide covers setup, formatting, and fixing the usual problems.
What You'll Need
- Excel for Windows, Mac, or Excel for the web. Menu labels can differ slightly by version, platform, and region.
- Data arranged in columns or rows, with a header row if you want series names and a category label column if you want axis labels.
- Numbers stored as numbers, not text. Left-aligned numbers are usually text and will not plot correctly.
Step-by-Step
- Lay out the data. Put category labels (dates, months, names) in the leftmost column and one numeric column per line you want to plot. Put a heading in the top row of each column.
- Select the range. Click the top-left cell of your data and drag to the bottom-right, including the header row. Do not include totals rows or blank rows.
- Insert the chart. On the ribbon, open the Insert tab and click the Line chart button in the Charts group. Pick a basic 2-D line, or Line with Markers if you want a dot on each data point.
- Check what Excel plotted. If the series and categories are swapped, select the chart, open Chart Design (called Chart Design or Design depending on version), and click Switch Row/Column.
- Add axis titles. With the chart selected, click the + button at the top-right of the chart (or Chart Elements on older versions) and tick Axis Titles, then type your labels.
- Set the vertical axis scale. Right-click the vertical axis and choose Format Axis. Set the minimum and maximum so the line is not squashed into a flat band.
- Label the series. Tick Legend in Chart Elements, or right-click a line and choose Add Data Labels to put values on the points.
- Format the lines. Right-click a line and choose Format Data Series to change colour, line width, or marker style. Use Chart Styles on the Chart Design tab for a quick restyle.
- Move and size the chart. Drag the chart border to reposition it, or drag a corner handle to resize. Use Move Chart on the Chart Design tab to place it on its own sheet.
- Save. Press Ctrl+S (Cmd+S on Mac). Charts are saved inside the workbook, so the file must be shared for others to see it.
Common Mistakes
- Including totals in the range. A total row dwarfs the real data and flattens the line. Select only the detail rows.
- Numbers stored as text. If the line is missing or the axis shows evenly spaced labels instead of values, the cells are probably text. Convert them with Data > Text to Columns or by retyping.
- Wrong chart type for the data. A line chart implies a trend over an ordered category such as time. For unrelated categories, a column or bar chart reads better.
- Forgetting the header row. Without headers, series are named Series1, Series2, and the legend is meaningless.
- Too many series. More than a handful of lines becomes unreadable. Split into small multiples or highlight one line.
Tips
- Leave a blank cell where a data point is missing; Excel breaks the line there. A zero plots as a real zero and can mislead.
- Use a date column formatted as dates so the horizontal axis spaces points by time rather than evenly.
- Right-click the horizontal axis and open Format Axis to change label intervals if dates overlap.
- Press F11 on Windows to create a chart on a new sheet instantly from the selected range.
- Copy the chart and use Paste Special as a picture when you need a static image for a document.
Troubleshooting
- The chart is blank. Check that the selected cells contain numbers, not text or formulas returning text. Re-select the range and insert again.
- The line is flat at the bottom. One very large value is stretching the axis. Right-click the vertical axis, choose Format Axis, and set a sensible maximum, or remove the outlier.
- Dates are bunched on the right. The axis is treating dates as text. Format the source column as Date and re-create the chart.
- Legend names are wrong. Excel took the wrong row as headers. Open Select Data on the Chart Design tab and set the correct series names and category range.
- The chart will not update. Check that the chart's source range still covers the cells. Open Select Data and widen the range.
- If that did not work, copy the data to a new sheet, remove blank rows, and insert a fresh chart. Corrupted formatting travels with a copied chart, so build a new one rather than repairing the old.
Frequently Asked Questions
How do I add a second line to an existing chart?
Right-click the chart, choose Select Data, click Add under Legend Entries (Series), and point at the new column. The new line appears on the same axes.
Can I plot two lines with different scales?
Yes. Right-click the second series, choose Format Data Series, and select Secondary Axis. Both axes then appear on the chart.
Why does my line chart show dots but no line?
The chart type is probably a scatter chart with markers only. Change it via Chart Design > Change Chart Type to a line chart.
How do I show a trend line?
Right-click a data series and choose Add Trendline. Pick linear or another type that fits the data, and tick Display Equation on chart if you need the formula.
Can I make a line chart in Excel for the web?
Yes. Select the data, open Insert, and choose a line chart. Formatting options are fewer than in the desktop app but the basics work.
How do I remove gridlines or the legend?
Click the + button at the top-right of the chart and untick Gridlines or Legend.