Excel Trendline Equation Without a Chart

Charts & pivot tables · Updated November 3, 2026

Excel Trendline Equation Without a Chart

Yes. In Excel for Microsoft 365 on Windows, calculate a linear trendline without creating a chart by using SLOPE and INTERCEPT: they return the line’s slope and y-intercept from your x- and y-values. For other trendline types, use LINEST or transform the data, as appropriate.

What a trendline equation represents

A trendline summarizes the relationship between two sets of numeric values. For a linear trendline, the equation is written as y = mx + b: m is the slope, or change in y for each one-unit increase in x, and b is the y-intercept, or predicted y-value when x is zero. Excel estimates these values using least-squares regression, which chooses the line that minimizes the sum of the squared differences between observed and predicted y-values.

A chart is only one way to display the result. Excel’s regression functions calculate the coefficients directly from worksheet ranges, so you can use them in reports, formulas, or models without inserting a chart. This is useful when the equation must update as data changes, or when a chart would add clutter.

Keep the data roles straight: the known x-values are the explanatory or input values, and the known y-values are the outcomes being predicted. Reversing the two ranges calculates a different regression, not a rearrangement of the same line.

Calculate a linear equation with worksheet functions

Place the x-values in one column and the corresponding y-values in another, keeping each pair on the same row. For example, put x = 1, 2, 3, 4, 5 in A2:A6 and y = 3, 5, 7, 9, 11 in B2:B6. The values follow the line y = 2x + 1, so the expected slope is 2 and the intercept is 1.

  • With x-values in A2:A6 and y-values in B2:B6, enter =SLOPE(B2:B6,A2:A6). It returns 2.
  • With the same ranges, enter =INTERCEPT(B2:B6,A2:A6). It returns 1.

Read those results as y = 2x + 1. The order of arguments matters: both functions take the y-values first and the x-values second. If your data is in different columns, replace the ranges but preserve that order. The x and y ranges must have the same number of observations.

For a quick check, with the x-values in A2:A6, y-values in B2:B6, and a test x-value of 6 in D2, enter =SLOPE(B2:B6,A2:A6)*D2+INTERCEPT(B2:B6,A2:A6). The result is 13, which is the prediction from 2 × 6 + 1. For a reusable sheet, calculate slope and intercept in separate cells and refer to those cells in the prediction formula instead of recalculating both functions each time.

Check fit with R-squared and LINEST

The coefficients define a line, but they do not tell you how closely the line follows the observations. The coefficient of determination, commonly called R-squared, is one measure of fit. With x-values in A2:A6 and y-values in B2:B6, enter =RSQ(B2:B6,A2:A6). For the example data, it returns 1 because every point lies exactly on the line. With real data, a result nearer 1 indicates that the linear model explains a larger share of the variation in y, but it does not prove that x causes y or that the relationship will continue outside the observed range.

LINEST is useful when you want regression statistics as well as coefficients, or when you have more than one input variable. With the same one-variable data in A2:A6 and B2:B6, enter =LINEST(B2:B6,A2:A6,TRUE,TRUE) in a clear area. In current Microsoft 365 for Windows, the results spill into a 5-row by 2-column array: the first row contains slope 2 and intercept 1, followed by additional regression statistics. The first argument is the known y range; the second is the known x range. The final TRUE requests statistics, while the preceding TRUE allows an intercept to be calculated.

If you only need the slope and intercept, the two simpler functions are easier to read. In older Excel versions that do not spill array results, LINEST may require selecting the output range and confirming it as an array formula with Ctrl+Shift+Enter. On Excel for Mac, the functions are the same; the array-entry shortcut can differ by keyboard and version, so use the version’s formula-entry instructions. Microsoft 365’s dynamic-array behavior avoids that legacy step.

Fit a polynomial trendline without a chart

A polynomial model can describe curvature, such as a U-shaped or steadily accelerating relationship. Excel’s chart trendline options include polynomial curves, but a worksheet calculation is possible too: add columns containing powers of x, then regress y against those columns. For a quadratic fit, the predictors are x and x squared. A cubic fit adds x cubed. Higher degrees can follow the training data closely while behaving poorly elsewhere, so choose a degree for a reason rather than simply maximizing fit.

For a concrete example, put x = 1, 2, 3, 4, 5 in A2:A6 and y = 6, 15, 28, 45, 66 in B2:B6. These values follow y = 2x² + 3x + 1. With x in A2:A6, enter =A2^2 in D2 and fill down through D6; the first result is 1. Use C2:C6 for the original x-values, copied from A2:A6. With y in B2:B6, x in C2:C6, and x squared in D2:D6, enter =LINEST(B2:B6,C2:D6,TRUE,FALSE). The three outputs, from left to right, are 2, 3, and 1: the coefficient for x squared, the coefficient for x, and the intercept. In Microsoft 365, the outputs spill horizontally. The reverse order of the predictor coefficients is important when reading the result.

Calculate exponential, logarithmic, and power fits

Not every trendline is linear in the original values. A chart’s exponential trendline has the form y = a × e raised to bx; a power trendline has the form y = a × x raised to b; and a logarithmic trendline has the form y = a + b × ln(x). You can estimate these models without a chart by taking logarithms where the model permits, then applying linear regression to the transformed values.

  • Exponential: Take the natural logarithm of each y-value, then regress ln(y) against x. The slope is b; exponentiating the intercept gives a. This requires positive y-values.
  • Power: Regress ln(y) against ln(x). The slope is the power b, and exponentiating the intercept gives a. Both x and y must be positive.
  • Logarithmic: Regress y against ln(x). The slope and intercept correspond to b and a. The x-values must be positive.

For example, with x-values in A2:A6 and positive y-values in B2:B6, enter =LN(B2) in C2 and fill down to create transformed y-values. If B2 is 3, the result is approximately 1.098612. Then calculate the slope and intercept using C2:C6 as the y range and A2:A6 as the x range. For a power fit, create a second helper column with =LN(A2) and use that as the x range instead. These transformations are a practical way to fit the stated model, but they minimize squared errors in the transformed values, not necessarily in the original y-values. That distinction can matter when comparing models or interpreting residuals.

Choose the right approach for your data

Start with the relationship you have reason to model, not just the equation that produces the largest R-squared. Use a linear fit when a roughly constant change in y per unit of x is plausible. Consider an exponential model when change is proportional to the current level, a logarithmic model when increases taper as x grows, and a polynomial when the data shows a clear curve. These descriptions are clues, not proof; subject knowledge and the data collection process matter.

Also distinguish between a trendline and a forecast. A trendline equation describes a fitted relationship in the observed data. Using it to predict beyond the measured x-range is extrapolation, which can be unreliable, especially for polynomials. A high R-squared does not fix a poor model choice, guarantee accurate future values, or reveal whether unusual observations are driving the fit.

Common problems and how to avoid them

  • Unequal range sizes: The x and y ranges must contain the same number of paired observations. Check that the first and last rows align.
  • Headers included as data: Use ranges that begin below text headings, unless you have deliberately handled the labels. Text values and blanks can lead to unexpected results or mismatched observations.
  • Wrong order: Use y-range first and x-range second in SLOPE, INTERCEPT, RSQ, and LINEST. Swapping them changes the regression.
  • Zero or negative values in log models: LN is undefined for zero and negative real numbers. Exponential fitting needs positive y; power fitting needs positive x and y; logarithmic fitting needs positive x.
  • Rounded chart equation: A chart label may display only a few decimal places. Using those displayed rounded coefficients can produce slightly different predictions from worksheet functions, which retain greater precision. Increase the label’s displayed precision if comparing results.
  • Unexpected intercept: By default, a linear regression estimates an intercept. Forcing the line through zero changes the model and should only be done when a zero intercept is justified. LINEST’s third argument controls whether the intercept is calculated.

Before relying on a result, inspect a scatter plot if the shape of the relationship is unclear, check for data-entry errors, and compare predicted values with actual values. You do not need to keep the chart in the final workbook; it can be a diagnostic aid rather than part of the calculation.

Worksheet formulas versus a chart trendline

For a simple linear model, SLOPE and INTERCEPT provide the clearest equation in worksheet cells. LINEST offers additional statistics and handles multiple predictors. A chart is more convenient when you want a visual representation, to compare several trendline types, or to present an equation label to readers. Both routes use regression ideas, but chart labels are primarily for display and may round coefficients. Worksheet formulas are usually the better choice when the coefficients feed other calculations or must update with changing data.

Excel for Mac includes the same core regression functions, although ribbon placement and array-entry behavior may vary by release. Excel for the web also supports common worksheet functions, but some chart-formatting controls and editing details can differ from the Windows desktop application. The formulas themselves do not require a chart or a special add-in.

Frequently Asked Questions

Can Excel show a trendline equation in a cell?
Yes. For a linear trendline, put SLOPE and INTERCEPT in cells and use their values as the coefficients. Excel does not need to create a chart to calculate them.

What is the formula for a linear trendline in Excel?
Use =SLOPE(y_range,x_range) for the slope and =INTERCEPT(y_range,x_range) for the intercept. Combine the returned values as y = mx + b, where m is the slope and b is the intercept.

How do I get the equation and R-squared without a chart?
Calculate slope and intercept with SLOPE and INTERCEPT, then calculate the fit statistic with =RSQ(y_range,x_range). Each function takes the y range first and the x range second.

Can LINEST calculate a quadratic equation?
Yes. Supply separate predictor columns for x and x squared as the known-x range, then use LINEST to calculate the coefficients. Read the returned predictor coefficients in reverse column order, followed by the intercept.

Why does my formula not match the chart’s equation?
The chart label may round its displayed coefficients, or the chart may use a different trendline type or a forced intercept. Confirm the model settings and increase the equation label’s displayed decimal places before comparing.

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.