Create a Line Chart in Excel: A Step-by-Step Guide

Charts & pivot tables · Updated November 3, 2026

Create a Line Chart in Excel: A Step-by-Step Guide

To create a line chart in Excel for Microsoft 365 on Windows, arrange your data in columns or rows with time periods in one series and values in another, select the data, then choose Insert > Insert Line or Area Chart > 2-D Line. Excel inserts a chart you can title, format, and adjust to make trends easier to read.

Prepare the data for a line chart

A line chart is most useful when the horizontal axis represents an ordered sequence, such as dates, months, or stages, and the vertical axis shows values measured at those points. Before inserting the chart, put the categories in one column and the values in the next, with a clear heading at the top of each column. For example, a monthly sales table could look like this:

  • Cell A1: Month; cells A2:A7: January through June.
  • Cell B1: Sales; cells B2:B7: 120, 135, 128, 160, 172, and 181.

Keep each row aligned: January’s value belongs on the same row as January, and so on. Use one row per time period and one column per data series when possible. If the table has blank rows, totals, notes, or unrelated columns between the labels and values, remove or exclude them from the chart selection. A tidy source range helps Excel identify the labels and series correctly.

Dates should be real Excel date values rather than text that only looks like a date. You can usually enter a date in a familiar format and let Excel recognize it; if necessary, set the cells to a date format with Home > Number Format. If Excel treats date labels as text, the chart may place them at equal category intervals rather than along a true date scale. For ordinary monthly reporting, evenly spaced categories are often fine. For irregularly spaced measurements, such as readings taken one, three, and ten days apart, an XY scatter chart may represent the spacing more faithfully.

Insert the chart step by step

  1. Select the complete data range, including the headings. In the example above, select A1:B7. Including the heading lets Excel use it as the series name.
  2. Choose Insert on the ribbon, then select Insert Line or Area Chart in the Charts group.
  3. Under 2-D Line, choose Line for a basic line chart. Excel inserts an embedded chart on the worksheet.
  4. Select the chart title and type a descriptive title, such as Monthly Sales, then press Enter.
  5. Save the workbook. The chart remains linked to its source cells, so edits to the values update the plotted line.

If you want Excel to suggest a chart first, select the data and choose Insert > Recommended Charts. Review the previews and choose a line chart if it communicates the data clearly. The exact arrangement of ribbon controls can change with window size; if the chart buttons are condensed, look for the Charts group on the Insert tab.

On Excel for Mac, select the data and use the Insert tab to choose the line-chart command; the ribbon layout and some labels can differ slightly from Windows. Excel for the web also supports inserting charts from the Insert tab, though its formatting controls are not identical to the desktop application. The chart’s basic setup is the same: select a well-organized range, insert the chart, and then refine its elements.

Choose the right line-chart type

Excel offers several line-chart variations. The simple 2-D Line chart connects each point with a line and is a sensible starting point for values over time. A Line with Markers adds a visible symbol at each observation, which can help when there are only a few periods or when readers need to identify individual measurements. With many closely spaced data points, markers can clutter the display, so a plain line may be easier to follow.

Stacked Line charts show how series contribute to a cumulative total across categories. They are appropriate only when the values can reasonably be added and the cumulative relationship matters. A 100% Stacked Line chart emphasizes each series’ share of the total rather than its absolute value. These types can be confusing when the main question is how each independent measure changes, so compare their meaning with the question you need the chart to answer.

Be cautious with 3-D chart styles and smoothed lines. Three-dimensional effects can make values harder to compare, and smoothing can imply a shape between observations that the data does not establish. For an ordinary time series, a clean 2-D line with clearly labeled axes is often the most direct choice.

Format the title, axes, and data series

Select the chart to show chart controls and contextual ribbon tabs. In Microsoft 365 for Windows, use Chart Design > Add Chart Element to add or change elements such as axis titles, a legend, gridlines, and data labels. You can also use the plus-shaped Chart Elements button beside a selected chart when it appears. Add only elements that help a reader understand the values. A chart title should say what is measured, and axis titles should state the measure and, where relevant, its units, such as Revenue (dollars).

Use the legend when the chart contains multiple series and their names are not otherwise obvious. If there is only one line, a legend often adds little; the title or a direct label can identify it instead. Data labels can be useful for a small number of points, but displaying a label at every point in a dense chart can overwhelm the trend. Gridlines help readers estimate values, though heavy gridlines compete with the data. Keep them light and limited to useful intervals.

To change a line’s appearance, select it and use the Format tab or the Format Data Series pane. Right-clicking the series and choosing Format Data Series is another route. Choose colors with enough contrast from the chart background and from other lines. If the chart will be printed in grayscale or viewed by people with color-vision differences, distinguish series with markers or line styles as well as color. Avoid changing line width or color in ways that make one series appear more important unless that emphasis is intentional.

For number formatting on an axis, right-click the axis and choose Format Axis, then use the pane’s Number options. Currency, percentages, and compact number formats can make a scale easier to interpret, but the displayed format should reflect what the underlying values mean. For example, formatting 0.25 as a percentage displays 25%, which is appropriate only if the value represents a proportion.

Set the horizontal and vertical axes

Excel normally selects a vertical-axis range based on the data. A scale that starts above zero can make modest changes look dramatic; a scale that starts at zero can make small movements harder to see. Neither choice is automatically right for every line chart. For a chart of quantities where absolute size matters, a zero baseline often helps comparison. For a measure where the pattern of small changes is the focus, a narrower range may be useful, but label the scale clearly and avoid giving a misleading impression.

To adjust it, right-click the vertical axis and choose Format Axis. In Axis Options, set the minimum, maximum, or major unit when the automatic scale does not serve the chart’s purpose. You can return a bound to automatic behavior by clearing the manually specified value or restoring the automatic setting shown in the pane. Check that all plotted points remain visible after changing bounds.

If dates or category labels are crowded, make the chart wider, reduce the number of displayed labels, or format the labels to use a shorter date style. You can right-click the horizontal axis and open Format Axis to review its available label and axis options. For a long daily series, showing every date label may be unreadable; displaying selected intervals can preserve the time context without crowding. Excel’s date-axis controls depend on how it recognizes the source values, so first confirm that the cells contain real dates.

Handle multiple series and data orientation

To compare several measures, place each series in a separate value column with a shared category column. For instance, a table with Month, Product A, and Product B headings can produce two lines across the same monthly axis. Select all three columns before inserting the chart. Keep the series units comparable: placing dollars and percentages on one scale can make one line appear flat or distort the comparison.

If Excel places months in the legend and draws each product as a separate category, the rows and columns may be interpreted in the opposite direction from what you intended. Select the chart, then choose Chart Design > Switch Row/Column. This changes how Excel assigns categories and series without changing the source data. Check the legend and horizontal-axis labels afterward to make sure they match your intended comparison.

A secondary vertical axis can be useful when two related series have substantially different units or scales, but it can also exaggerate apparent relationships. Use it only when the distinction is explained with clear axis titles and readers can tell which line belongs to which scale. If the series are unrelated, separate charts are often easier to understand.

Keep the chart current as data changes

A chart based on a fixed cell range includes the cells in that range. If new rows are added below it, Excel may not include them automatically. For a data set that will grow, convert the source range into an Excel table: select a cell in the data and choose Insert > Table, confirm that the table has headers if it does, and select OK. Charts built from table data can expand as new rows are added to the table, making them convenient for recurring reports.

When you need to change the source range of an existing chart, select the chart and choose Chart Design > Select Data. In the Select Data Source dialog, review the chart data range, series, and category labels. This is also where you can add, remove, or edit series. If the chart looks blank after editing, check that its source range still points to the intended cells and that the cells contain numeric values rather than text.

Common line-chart problems and fixes

  • The line is missing: Check whether the values are stored as numbers, whether the intended series is included in Select Data, and whether the axis bounds exclude the values.
  • The categories and series are reversed: Use Chart Design > Switch Row/Column, then confirm the labels and legend.
  • Dates appear out of order: Sort the source table chronologically. A line chart connects points in category order; it does not automatically correct a shuffled table.
  • Blank cells create gaps: Select the chart, choose Chart Design > Select Data, then use Hidden and Empty Cells to review how empty cells are displayed. Available choices include showing empty cells as gaps, zero, or connected data points; choose the one that accurately represents missing information.
  • The chart is hard to read: Reduce unnecessary series, use clearer labels, widen the chart, or use markers only when individual points need emphasis.

Do not replace missing observations with zero unless zero is the true measured value. A missing reading and a recorded reading of zero mean different things. Connecting across a gap can also imply continuous information where none was collected. Choose the display treatment that matches how the data was gathered, and explain important gaps if readers might mistake them for ordinary variation.

When a line chart is not the best choice

A line chart works well for ordered categories and trends, but it is not ideal for every comparison. Use a column chart when the purpose is to compare separate categories, such as sales by region, and there is no meaningful sequence between them. Use a scatter chart when both horizontal and vertical values are numeric and the spacing between horizontal values matters, such as comparing temperature with energy use. Scatter charts are also a better fit for exploring whether two measured variables are associated.

A line chart can still be appropriate for categories that are not dates if they have a meaningful order, such as steps in a process or age groups. If the categories have no natural order, joining them with a line may suggest continuity or progression that is not present. In that case, a bar or column chart is usually clearer.

Frequently Asked Questions

How do I make a line chart in Excel with two sets of data?
Select the category column and both value columns, including their headings, then choose Insert > Insert Line or Area Chart > 2-D Line. Excel should create one line for each value column. If the categories and series are reversed, select the chart and choose Chart Design > Switch Row/Column.

How do I add a title to a line chart in Excel?
Select the chart and choose Chart Design > Add Chart Element > Chart Title, then select an available title position. Click the title box on the chart and enter descriptive text. A useful title identifies the measure or comparison rather than repeating a vague label such as Chart Title.

Why is Excel showing the wrong data on my line chart?
The selected range may include unrelated cells, omit a series, or have headings and categories arranged unexpectedly. Select the chart and choose Chart Design > Select Data to inspect the chart data range and series. Use Switch Row/Column if Excel interpreted the orientation incorrectly, and verify that the source rows are in the intended order.

How do I show missing values as gaps instead of zeros?
Select the chart, choose Chart Design > Select Data, and open Hidden and Empty Cells. Set empty cells to display as gaps if that best reflects the data. This setting affects empty cells; a cell containing the number zero is still a recorded zero and is plotted as such.

Can I make an Excel line chart update when I add data?
Yes. Convert the source range to an Excel table using Insert > Table, then build the chart from the table. New rows added to the table can be included in the chart automatically. For an existing chart that does not include new data, inspect its range with Chart Design > Select Data.

Related

Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.

More in Charts & pivot tables

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.