How to Create a Linear Chart in Excel
In this article
A linear chart in Excel is a line chart that plots data points connected by straight line segments, showing trends over time or across categories. To create one, select your data, go to Insert > Charts > Line, and pick the style you want. Excel then draws the chart on the same sheet, and you can refine axes, labels, and formatting from the Chart Design and Format tabs. The steps below work in Excel for Microsoft 365, Excel 2021, and Excel 2019 on Windows and Mac; menu labels can differ slightly by version, device, or region.
What You'll Need
- Excel installed on your computer (desktop version recommended; the web version has fewer chart options).
- Data arranged in two columns or rows: one for the independent variable (such as dates or categories) and one for the dependent variable (the values you want to plot).
- Headers in the first row or column so Excel can label the axes automatically.
Step-by-Step
- Open your workbook and locate the data you want to chart. For a linear chart, the data should be numeric and ideally sorted in the order you want it plotted (for example, oldest date first).
- Select the range including headers. For example, if your dates are in A1:A12 and values in B1:B12, select A1:B12. Do not include blank rows or columns inside the range.
- Go to the Insert tab on the ribbon. In the Charts group, click the Line chart icon (it looks like a small line graph).
- Choose a chart subtype from the drop-down. For a simple linear chart, pick the first option under 2-D Line, usually labeled "Line" or "Line with Markers." Avoid 3-D line charts unless you specifically need one, as they are harder to read.
- Excel inserts the chart on the same worksheet. Drag it by its border to reposition, or drag a corner handle to resize it.
- Use the Chart Design tab (called Chart Design or Design depending on your version) to change the chart style, switch rows and columns if Excel plotted the wrong series, or add chart elements.
- Click Add Chart Element (or the plus sign next to the chart in newer versions) to turn on Axis Titles, Chart Title, Data Labels, and Legend. Type descriptive titles, such as "Monthly Sales" for the chart and "Month" and "Revenue" for the axes.
- Right-click the horizontal axis and choose Format Axis to adjust the axis type, bounds, and units. For dates, Excel may automatically use a date axis; if not, set Axis Type to Date axis in the Format Axis pane.
- Right-click the vertical axis and choose Format Axis to set minimum and maximum values, major units, and number format. This is useful when your data starts far from zero and the line looks flat.
- Right-click the line itself and choose Format Data Series to change line color, thickness, and marker style. For a clean linear look, keep the line solid and use markers only if you need to highlight individual points.
- To add a trendline, right-click a data series and choose Add Trendline. In the Format Trendline pane, choose Linear and optionally display the equation and R-squared value on the chart.
- When the chart looks right, save the workbook. To reuse the chart style, right-click the chart and choose Save as Template, then apply it later from Insert > Charts > Templates.
Common Mistakes
- Selecting only the value column and leaving out the category or date column, which makes Excel use 1, 2, 3 as the horizontal axis.
- Including totals or subtotals in the selected range, which distorts the line.
- Leaving blank cells inside the range; Excel may plot gaps or connect points incorrectly. Right-click the chart and choose Select Data to check the range.
- Using a line chart for categories that have no natural order, such as unrelated product names. A column chart is usually clearer for those.
- Forgetting to sort dates chronologically, which makes the line zigzag.
- Choosing a 3-D line chart, which can hide data points behind others and makes values harder to compare.
Tips
- Keep the chart simple: one line per series is easiest to read. Add a legend only when you have more than one series.
- Use a date axis when your horizontal values are dates; Excel then spaces points evenly by time rather than by row number.
- Format the vertical axis to start at zero unless your data range is narrow and the variation matters more than the absolute values. If you do not start at zero, note it in the axis title or caption.
- Press Alt+F1 (Windows) to create an embedded chart from the selected range instantly, or F11 to create a chart on its own sheet.
- Copy the chart and paste it into Word or PowerPoint as a picture if you need a fixed version, or paste it linked if you want it to update with the workbook.
- Use Chart Design > Change Chart Type to switch between line and scatter with straight lines if you need to plot two numeric variables against each other rather than a sequence.
Troubleshooting
- The line is flat or missing. Check that the value column contains numbers, not text. Cells formatted as text are ignored by charts. Select the column, then use Data > Text to Columns or change the cell format to Number.
- The horizontal axis shows 1, 2, 3 instead of dates or labels. The category column was not included in the range. Right-click the chart, choose Select Data, and edit the Horizontal (Category) Axis Labels to point to your date or label column.
- The chart plots the wrong series. On the Chart Design tab, click Switch Row/Column. Then check the Select Data dialog to confirm which column is the category axis and which is the value series.
- Dates are spaced unevenly. Right-click the horizontal axis, choose Format Axis, and set Axis Type to Date axis. If the option is greyed out, your category cells may not be real dates; convert them with Date > Text to Columns or by retyping them in a recognized date format.
- The chart does not update when data changes. Confirm the chart's source range covers the cells you are editing. If you added rows below the original range, drag the range handle or use Select Data to expand it. Tables (Insert > Table) expand automatically.
- Excel crashes or the chart will not insert. Save your work, close and reopen Excel, and try again. If the problem persists, start Excel in safe mode (hold Ctrl while opening on Windows) to rule out add-ins, then disable add-ins from File > Options > Add-ins.
Frequently Asked Questions
What is the difference between a line chart and a linear chart in Excel?
Excel does not have a chart type called "linear chart." A line chart with straight segments is what most people mean. A scatter chart with straight lines and no markers is the other common option when both axes are numeric.
Can I create a linear chart in Excel for the web?
Yes. Select your data, go to Insert > Charts, and choose Line. The web version offers fewer formatting options than the desktop app, but basic line charts, axis titles, and data labels are available.
How do I add a straight trendline to my line chart?
Right-click a data series and choose Add Trendline, then select Linear. You can display the equation and R-squared value on the chart from the same pane.
Why does my line chart connect points across blank cells?
Excel's default is to connect points across gaps. To show gaps instead, right-click the chart, choose Select Data, click Hidden and Empty Cells, and select Gaps.
Can I plot two lines on the same linear chart?
Yes. Include both value columns in the selected range before inserting the chart, or right-click the chart and choose Select Data > Add to add a series. Each series gets its own line and legend entry.
How do I move the chart to its own sheet?
Right-click the chart and choose Move Chart, then select New sheet and give it a name. On Windows you can also select the chart and press F11.