Excel Trendline Slope Formula: Find and Interpret It

Charts & pivot tables · Updated November 21, 2026

If your x-values are in A2:A6 and your y-values are in B2:B6, calculate the linear trendline slope in Excel with =SLOPE(B2:B6,A2:A6). The result is the estimated change in y for each one-unit increase in x; you can also show the slope on a chart by displaying a linear trendline equation.

The Excel formula for a trendline slope

Excel’s SLOPE function calculates the slope of the straight line that best fits a set of paired x- and y-values using least-squares regression. Its argument order matters: put the known y-values first and the known x-values second. The function returns one number, not a chart or a full equation.

For example, suppose A2:A6 contains 1, 2, 3, 4, 5 and B2:B6 contains 4, 7, 10, 13, 16. With those values in those cells, =SLOPE(B2:B6,A2:A6) returns 3. In this dataset, y rises by 3 whenever x rises by 1, so the points sit exactly on a line with slope 3.

The formula also works when the points do not fall exactly on a straight line. In that case, Excel finds the slope of the best-fitting straight line through the data. The output is still a single number, but it summarizes the overall linear direction rather than describing every individual step between observations.

What the slope means

A trendline is commonly written as y = mx + b. Here, m is the slope and b is the y-intercept: the predicted y-value when x equals zero. A positive slope means the fitted line rises as x increases; a negative slope means it falls. A slope near zero means the fitted line is comparatively flat, though that alone does not prove there is no meaningful relationship.

Interpret the number in the units of your data. If x is measured in months and y is measured in units sold, a slope of 3 means the fitted sales value increases by 3 units per month. If x is measured in dollars and y in seconds, the slope is seconds per dollar. The slope is not a percentage unless the data and units make it one.

The slope describes the fitted relationship, not necessarily cause and effect. A rising trendline does not establish that changes in x caused changes in y; other variables, the choice of time period, or the way observations were collected may matter. Use the result as a summary of the data, not as proof of a causal explanation.

Worked example with an intercept

Using the example above, x takes the values 1 through 5 and y takes the values 4, 7, 10, 13, and 16. The fitted line is y = 3x + 1: its slope is 3 and its intercept is 1. The intercept can be calculated from the same paired ranges. With x-values in A2:A6 and y-values in B2:B6, enter =INTERCEPT(B2:B6,A2:A6); Excel returns 1.

That result checks against the data: when x is 1, 3 times 1 plus 1 equals 4, and when x is 5, 3 times 5 plus 1 equals 16. This clean example makes the arithmetic easy to verify, but real data often scatter around the fitted line. Then the slope and intercept describe the line that best balances the vertical differences between observed and predicted y-values.

Keep each x-value paired with the y-value from the same observation. If you sort one column without sorting the other, or shift one range by a row, Excel will calculate a slope for mismatched pairs. The formula may return a plausible-looking number even though the input data no longer represents the relationships you intended.

Find the slope on an Excel chart

A chart is useful when you want to see the pattern and communicate its fitted line. In Excel for Microsoft 365 on Windows, arrange numeric x-values in one column and y-values in another, select both columns, then choose Insert > Insert Scatter (X, Y) or Bubble Chart > Scatter. A scatter chart uses the x-values as numeric positions, which is important when the intervals between x-values are unequal.

Select the chart, then choose Chart Design > Add Chart Element > Trendline > Linear. To show the equation, open Chart Design > Add Chart Element > Trendline > More Trendline Options. In the Format Trendline pane, select Display Equation on chart. The coefficient multiplying x in the displayed linear equation is the slope; the constant term is the intercept.

The Excel for Mac chart workflow is similar: select the chart and use the Chart Design controls to add a linear trendline and display its equation. Ribbon placement can vary with the window size or version. In Excel for the web, chart editing controls may be arranged differently, so use the chart’s available trendline and formatting options if they are present; the SLOPE worksheet formula remains a direct way to calculate the value.

Chart equations may be rounded for display. If the equation shows a slope such as 2.4, that may be a shortened presentation rather than the full-precision value used internally. Increase the displayed equation’s decimal places in its formatting options, or use SLOPE in a worksheet cell when you need the numeric result at Excel’s stored precision.

When to use SLOPE and when to use a chart

Use SLOPE when you need a dependable value in a cell—for another calculation, a report, or a comparison across many datasets. It is also convenient when you do not need to create a chart. Use a chart when seeing the shape, outliers, clusters, or unusual observations is part of the analysis. Many workflows use both: inspect the scatter plot, then calculate the slope in the worksheet.

For the chart and worksheet calculation to agree, make sure the plotted series uses the same x- and y-values, the chart trendline is linear, and no points have been excluded from one calculation but not the other. A trendline equation displayed with limited decimal places can look different from the full result of SLOPE even when both calculations use the same observations.

Do not confuse slope with R-squared. The slope tells you the direction and rate of change in the fitted line. R-squared is a separate statistic associated with how well a trendline fits the data in the chart. A large positive slope does not automatically mean a strong fit, and a small slope does not automatically mean a poor one.

Accuracy checks and data preparation

Before relying on a result, check the data layout and the meaning of both axes. Use these checks:

  • Confirm that each x-value and y-value belong to the same record and that the selected ranges cover the intended observations.
  • Check that both ranges contain numeric values. Text labels, blank cells, and error values can affect which observations are usable or cause a calculation problem.
  • Look for outliers and a curved pattern. A straight-line slope can hide a nonlinear relationship or be strongly influenced by one unusual point.
  • Confirm that x-values vary. If all x-values are the same, there is no horizontal spread from which to estimate a finite line slope.
  • Verify the units and direction of each variable before explaining what the number means.

For a trend over time, the choice of x-values matters. If measurements are taken on irregular dates, using a scatter chart with actual date values preserves the time gaps. A line chart can space category labels evenly, so its trend may represent the order of categories rather than elapsed time. For a rate per day or per month, use x-values that encode the actual elapsed time in the unit you want to interpret.

Common mistakes and what they mean

A frequent error is reversing the SLOPE arguments. Excel expects y-values first and x-values second. Reversing them calculates a different relationship, not a cosmetic variation. Another common issue is using a row of dates or labels as if it were a meaningful numeric scale. Make sure Excel is using the intended numeric x-values rather than simply the order of categories.

A linear trendline is not appropriate for every pattern. If the points bend, a single slope can be a poor summary; Excel offers other trendline types, but their equations do not all have one constant slope. For example, a curve’s rate of change can vary along the x-axis. Do not read one coefficient from a nonlinear equation as though it were the same kind of constant slope as the coefficient in a straight-line equation.

Also, a chart equation that appears to have a zero intercept may have been configured to force the trendline through zero, or the displayed value may simply be rounded. For a standard straight-line fit, check the trendline settings and compare with the worksheet result. Forcing an intercept to zero changes the fitted line and can change its slope, so do so only when the data model calls for that constraint.

Frequently Asked Questions

What is the syntax for the Excel SLOPE function?
Use the known y-values first and known x-values second: =SLOPE(known_y's,known_x's). The two sets should represent paired observations and should have corresponding dimensions.

How do I get a trendline slope without making a chart?
Put the paired x- and y-values in worksheet ranges and use SLOPE with the y-range first. The result is the fitted linear slope, so you do not need to add a chart to calculate it.

Why does my chart’s slope differ from the SLOPE result?
Check that both use the same observations and that the chart trendline is linear. Also check whether the chart equation is rounded, whether any points were excluded, and whether the chart uses the intended x-values.

Is the slope the same as R-squared?
No. Slope is the fitted line’s change in y for a one-unit increase in x. R-squared is a separate measure associated with the fit. They answer different questions and should not be interpreted interchangeably.

Can a trendline slope be negative?
Yes. A negative slope means the fitted y-value decreases as x increases. Its size describes the fitted rate of decrease in the units of y per unit of x; it does not by itself establish why the variables move together.

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.