To make an Excel line chart, put your x values in one column and the matching y values in the next, select both columns, then choose Insert > Insert Line or Area Chart > Line. One important distinction: a line chart treats x values as category labels; if your x values are numeric measurements that must determine the points’ horizontal positions, use an XY scatter chart instead.
What a Line Chart Does With X and Y Values
A chart needs paired data: each x value identifies a position or category, and its y value supplies the amount to plot there. For example, a weekly table might pair Monday, Tuesday, and Wednesday with sales of 12, 18, and 15. Excel draws a point for each sales value and connects the points in the order of the x labels.
In a standard line chart, the horizontal axis is a category axis. Excel spaces its labels at regular intervals, rather than calculating the distance between them from their numerical size. This works well for dates, months, product names, and other ordered labels when each entry should occupy one step on the chart.
That behavior can be surprising when the x values are numbers. If the pairs are (1, 4), (2, 7), and (10, 8), a line chart generally gives the three x labels equal category spacing. It does not place 10 ten times farther along the axis than 1. An XY scatter chart does use the x values as numerical coordinates, so the last point appears farther from the first two.
Prepare the Data in Two Columns
Arrange the data in a simple rectangular range, with one x value and one y value on each row. Add a header to each column so Excel can identify the series and axis labels. For example:
- Column A: Month, with January, February, March, and April.
- Column B: Units sold, with 120, 145, 132, and 171.
Keep each x value beside the y value that belongs to it. Avoid blank rows inside the data, merged cells, and explanatory notes mixed into the range. Those can make Excel guess the wrong chart range or treat a label as a data point. If there are multiple y series, use one column for the shared x labels and a separate column for each series, with a header above each.
Check the underlying values before charting. A date that is stored as text may behave like a category label instead of a date. Numbers imported with leading apostrophes or inconsistent decimal separators can also be stored as text. Select a suspect cell and check its alignment or the formula bar, and use Excel’s number-format controls or data-cleaning tools if the values need conversion.
Create a Line Chart in Excel for Windows
- Enter the x values and y values in adjacent columns, including column headings.
- Select the complete range, including the headings. For example, select A1:B5 if the headers are in row 1 and four pairs are in rows 2 through 5.
- On the ribbon, choose Insert > Insert Line or Area Chart, then choose Line. A 2-D Line chart is a suitable starting point for most simple series.
- Review the chart. Excel should use the first column for horizontal labels and the second column as the plotted series.
- Click the chart title and replace it with a description that identifies the measure and, if useful, its period or units.
If the chart appears with the wrong orientation, select it and choose Chart Design > Select Data. In the Select Data Source dialog, check that the correct cells appear under Legend Entries (Series) and that the x-label cells are assigned under Horizontal (Category) Axis Labels. Use Edit to change a series name or its values, or to select a different label range. The Mac ribbon has corresponding chart controls, although their placement or wording can vary slightly by Excel release. Excel for the web also offers chart insertion and editing, but some detailed formatting controls may be more limited than in the Windows desktop app.
When to Use an XY Scatter Chart Instead
Choose a scatter chart when both columns contain numbers and the distance between x values carries meaning. Common examples include elapsed time against temperature, distance against fuel use, or a measured input against a response. In those cases, unequal spacing is part of the information, not a visual detail to ignore.
Select the two columns and choose Insert > Insert Scatter (X, Y) or Bubble Chart > Scatter. Pick a scatter subtype with markers, or a subtype with straight lines if connecting the observations is appropriate. In a scatter chart, Excel uses the first selected numeric column as the x values and the next numeric column as the y values. If Excel assigns them incorrectly, open Chart Design > Select Data, choose the series, select Edit, and set the Series X values and Series Y values ranges separately.
A scatter chart can show points without connecting lines. That is often better when observations are independent, such as measurements from separate samples. Connecting lines imply an order or a continuous progression; use them when the data represent a sequence, such as readings over time. A scatter chart with straight lines still uses true numerical x positions, unlike a line chart.
Choose the Right Line Chart Variant
Excel’s line chart options mainly change how the series are drawn, not how the category axis works. A basic line chart connects the plotted values. A line chart with markers adds symbols at the individual observations, making it easier to see the original data points. Markers can help when there are only a few values, but a chart with many points can become crowded.
Stacked line charts show each series as part of a cumulative total, while 100% stacked line charts show each series as a share of the total at each category. These versions can be useful for composition over time, but they do not show each series’ original values directly. For instance, a stacked chart’s upper line represents a running total of series, not just the values in that series. Use a basic line chart when comparing actual y values across categories is the main goal.
For more than one y series, use a shared x-label column followed by one column for each measure. Excel gives each series a separate line and legend entry. If the measures have very different units or scales, consider separate charts before adding a secondary axis; a second scale can make relationships easy to misread.
Format the Axes and Make the Chart Readable
Give both axes informative titles when the meaning or units are not obvious. Select the chart, then use Chart Design > Add Chart Element > Axis Titles and choose the primary horizontal or vertical title. Use labels such as “Month” and “Units sold,” rather than generic terms such as “X” and “Y.” A y-axis number format should match the measure: for example, currency, percentage, whole number, or a unit such as kilometers.
To change an axis scale or number format, right-click the axis and choose Format Axis. The Format Axis pane includes settings for bounds, units, number formats, and other options appropriate to the axis type. Avoid changing the minimum or maximum casually: a truncated y-axis can exaggerate small differences. A zero baseline is often helpful for comparing magnitudes, though a different range may make sense for some measurements if it is clearly labeled and does not mislead.
Keep the visual hierarchy simple. Use a concise title, a legend only when there are multiple series, and gridlines light enough not to compete with the data. If dates crowd together, widen the chart, reduce the number of displayed labels, or adjust date-axis units where that option is available. Do not remove important labels just to make the chart look cleaner.
Common Problems and How to Fix Them
- The x values look evenly spaced when they should not: This is expected for a line chart’s category axis. Switch to an XY scatter chart if numerical spacing matters.
- The x labels show 1, 2, 3 instead of the intended values: Open Chart Design > Select Data and assign the correct cells as Horizontal (Category) Axis Labels.
- The series is plotted as labels or the chart is blank: Check that the y cells contain numeric values, not text, and that the selected range includes the data rows. Reassign the series values in Select Data if needed.
- Excel creates one line per row instead of per column: In Chart Design > Select Data, use Switch Row/Column and inspect the preview and legend. Choose the arrangement that treats each y column as a series.
- Dates are out of order: Sort the source table by date before charting. A line connects points in the order they appear in the data; it does not automatically sort observations by their x labels.
Also watch for missing values. Depending on chart settings and the way blanks are represented, Excel may leave a gap or connect across it. Select the chart and use Chart Design > Select Data > Hidden and Empty Cells to review the available display choices. A zero is not the same as a missing observation, so do not replace blanks with zeros unless zero is the actual value.
Line Chart or Scatter Chart: A Quick Decision
Use a line chart when x values are labels in a meaningful sequence and regular category spacing is acceptable: months, stages, or named groups are common cases. Use a scatter chart when x values are numerical measurements and their distances must determine horizontal placement. The two chart types can look similar once lines connect the points, but the axis interpretation differs.
A practical test is to ask whether a gap from x = 2 to x = 10 should look larger than a gap from x = 1 to x = 2. If yes, choose scatter. If each item should simply occupy the next position regardless of its numeric label, a line chart may fit. If the x values are dates, consider whether the intervals are regular: a line chart treats dates as categories in a sequence, while a scatter chart can represent elapsed time as numerical spacing. Pick the chart whose spacing tells the truth about the data.
Frequently Asked Questions
Can an Excel line chart use an x-value column?
Yes. Select the x and y columns together, and Excel can use the first column as horizontal category labels and the second as the series. The x values determine label order, but a line chart does not use numeric distances between them.
How do I make Excel use actual numeric x coordinates?
Insert an XY scatter chart instead of a line chart. Set the numeric x range and y range in the series settings if Excel does not assign them correctly. Scatter charts place points according to both coordinate values.
Can I put multiple y columns on one line chart?
Yes. Put the shared x labels in the first column and each y series in its own column, with a header for each series. Select the full range and insert a line chart; Excel should create one line per y column.
Why does my line chart show points in the wrong order?
Excel follows the order of rows in the source data. Sort the table by the x values when chronological or numerical order is intended. A line chart does not reorder the categories automatically.
Can I plot dates on the x-axis?
Yes. A line chart commonly uses dates as category labels. Confirm that Excel recognizes the entries as dates and that the source rows are sorted. If uneven date intervals need to appear at their true distances, use a scatter chart with date values on the x-axis.
Should I use a line chart with markers?
Markers are useful when readers need to identify individual observations, especially in a short series. For a long series, markers can clutter the chart; a plain line may communicate the overall pattern more clearly.
Related
- Excel Box Plot: Show the Median Line, Not the X
- Excel Box and Whisker Plot on a Log Scale?
- Excel Box and Whisker Plot Outliers: How They Work
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Excel Pivot Chart Not Showing All Data? FixesIf an Excel PivotChart is not showing all the data, first clear filters on the chart, its connected…
- Excel Pivot Chart Secondary Axis: The WorkaroundIn Excel for Microsoft 365 on Windows, you generally cannot put a native PivotChart series on a true…
- Clustered Column Line Combo Chart in Excel: How-ToTo make a clustered column and line combo chart in Excel for Microsoft 365 on Windows, select your…
- Excel Chart Average Line: Add and Format the MeanTo add an average line to an Excel chart, calculate the mean in a worksheet cell, repeat that…
- Excel Waterfall Chart Template: Build and Customize OneYes. In Excel for Microsoft 365 on Windows, select a category-and-value table, then choose Insert > Insert Waterfall,…
- Excel Chart Title From Cell: Link, Format, and FixesTo link an Excel chart title to a cell, select the chart title, click the formula bar, type…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.