To create a line chart in Excel, select your data range (including headers), go to the Insert tab, click the Line chart icon in the Charts group, and choose a style. Excel will place the chart on your sheet. You can then adjust the design, labels, and axes to make it clearer. This guide walks through the process step by step, covers common pitfalls, and explains how to fix charts that don't look right.
What You'll Need
- Microsoft Excel (any modern version: Microsoft 365, Excel 2019, 2021, or 2024). The steps are nearly identical across versions; menu labels may differ slightly.
- Data arranged in columns or rows with a clear header row. For a line chart, you typically need one column of categories (like dates or labels) and one or more columns of numeric values.
Step-by-Step
- Prepare your data. Enter your data in a table format. For example, put dates in column A and sales figures in column B. Ensure the first row contains headers (e.g., "Month" and "Sales"). Avoid blank rows or columns within the data range, as they can break the chart.
- Select the data range. Click and drag to highlight all the cells you want to include, including the headers. If your data is in a contiguous block, you can click any cell inside it and press Ctrl+A (Windows) or Command+A (Mac) to select the entire block.
- Go to the Insert tab. On the ribbon, click the Insert tab. In the Charts group, look for the Line chart icon (it looks like a zigzag line).
- Choose a line chart type. Click the Line icon to open the dropdown menu. You'll see several options: 2-D Line, 3-D Line, and Sparklines (sparklines are tiny charts that fit in a cell). For most purposes, choose 2-D Line and then pick the first style (Line) or the one with markers (Line with Markers).
- Insert the chart. Excel will immediately place the chart on your worksheet. You can drag it to reposition it or resize it by dragging its corners.
- Check the chart data. If the chart doesn't look right, right-click the chart and choose Select Data. In the dialog box, ensure your Chart data range is correct. You can also add or remove series and edit the horizontal (category) axis labels here.
- Add axis titles and a chart title. Click the chart to select it. Then click the Chart Elements plus button (a green plus sign) that appears at the top-right corner of the chart. Check the boxes for Axis Titles and Chart Title. Click each placeholder text and type your own labels.
- Format the axes. Right-click the vertical axis (values) and choose Format Axis. In the pane that opens, you can set the minimum and maximum bounds, change the units, and adjust the number format. Do the same for the horizontal axis if needed.
- Adjust the line style and colors. Click the line in the chart to select it. Go to the Format tab under Chart Tools and use the Shape Outline and Shape Fill options to change color, thickness, or add markers. Alternatively, use the Chart Styles gallery on the Design tab for quick presets.
- Add data labels if helpful. Click the Chart Elements plus button again and check Data Labels. This displays the exact values next to each point. You can format them by right-clicking a label and choosing Format Data Labels.
- Move or resize the chart. Drag the chart to a new location on the sheet. To move it to its own worksheet, right-click the chart and choose Move Chart, then select New sheet.
- Save your work. Press Ctrl+S (Windows) or Command+S (Mac) to save the workbook.
Common Mistakes
- Selecting the wrong data range. Including totals or blank rows can distort the chart. Always select only the data you want to plot.
- Forgetting headers. Without headers, Excel may treat the first row as data, leading to a series named "Series1" and missing axis labels.
- Using text instead of numbers. If your values are stored as text (e.g., with apostrophes or formatted as text), the line chart may not plot correctly. Convert them to numbers by using Text to Columns or retyping.
- Choosing the wrong chart type. A line chart is for trends over time or ordered categories. If your categories are not ordered (e.g., product names), consider a bar chart instead.
- Overcrowding the chart. Too many series or data points can make the chart unreadable. Limit to a few key series or use a secondary axis if scales differ.
Tips
- Use a scatter chart with smooth lines if your x-axis values are numeric and you want to show a trend line.
- Press Alt+F1 (Windows) to quickly create an embedded chart from selected data. On Mac, use Option+F1.
- To change the chart type later, right-click the chart and choose Change Chart Type.
- Keep your data in an Excel Table (Ctrl+T) so the chart updates automatically when you add new rows.
- Use the Format tab to precisely control line width, marker style, and axis line colors.
Troubleshooting
If your line chart doesn't appear as expected, try these fixes:
- Chart is blank or shows no lines: Check that your data range contains numeric values. If the cells are formatted as text, the chart may not plot them. Select the data, go to Data > Text to Columns, and finish the wizard to convert to numbers.
- Wrong categories on the horizontal axis: Right-click the chart and choose Select Data. Under Horizontal (Category) Axis Labels, click Edit and select the correct range.
- Lines are not connected: This can happen if there are blank cells in the data. Right-click the chart, choose Select Data, click Hidden and Empty Cells, and select Connect data points with line.
- Chart doesn't update when data changes: Ensure the chart is linked to the correct range. If you added rows, you may need to drag the blue and purple outlines on the worksheet to include new data, or convert your data to a Table.
- Axis labels are cut off: Resize the chart or adjust the font size. You can also right-click the axis, choose Format Axis, and under Labels, change the Label Position or Text direction.
Frequently Asked Questions
Can I create a line chart with multiple series?
Yes. Select all the columns you want to plot, including headers, then insert a line chart. Excel will create a separate line for each numeric column.
How do I add a trendline to a line chart?
Click the chart, then click the Chart Elements plus button and check Trendline. Choose the type (linear, exponential, etc.) and format it as needed.
Why does my line chart show dates as numbers?
Excel may treat dates as serial numbers. Right-click the horizontal axis, choose Format Axis, and under Axis Options, set the Number category to Date and choose a format.
Can I change the order of categories on the horizontal axis?
For a line chart, the category order is determined by the data order. To reverse the order, right-click the horizontal axis, choose Format Axis, and check Categories in reverse order.
How do I make the line smoother?
Right-click the line, choose Format Data Series, and under Line, check Smoothed line. Note that smoothing can misrepresent data, so use with caution.
Can I create a line chart on Excel for the web?
Yes. The steps are similar: select your data, go to the Insert tab, and choose Line. Some advanced formatting options may be limited compared to the desktop version.