Use a Linear Trendline Equation in Multiple Excel Cells
Question details
Calculate a linear trendline's coefficients once and use them in formulas across multiple worksheet cells.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user wants to evaluate a chart trendline equation for multiple input values without copying the displayed equation into every cell.
- Observed behavior
- A slope and intercept stored in worksheet cells can be referenced by formulas and filled down for multiple inputs.
Identify the X and Y ranges used by the chart series and confirm that the trendline is linear. The ranges should contain paired numeric values and at least two distinct X values.
Calculate the Linear Trendline Coefficients and Reference Them
Use SLOPE and INTERCEPT to calculate the coefficients once, then fill a prediction formula down the worksheet.
These formulas calculate a standard linear regression. Use the same source data as the chart series; results may differ if the chart uses a different trendline type or a fixed intercept.
In cell B1, enter =SLOPE(E2:E11,D2:D11), replacing E2:E11 with your Y values and D2:D11 with the corresponding X values.
In cell B2, enter =INTERCEPT(E2:E11,D2:D11), using the same Y and X ranges.
With an input value in C2, enter =$B$1*C2+$B$2 in an empty output cell. The dollar signs keep the coefficient references fixed.
Select the output cell and drag its fill handle down alongside the remaining input values in column C.

Apply a Linear Trendline Equation in WPS Spreadsheets
Use SLOPE and INTERCEPT in WPS Spreadsheets to calculate linear regression coefficients, then reference them in a formula for each input value.
- 1. Open the worksheet: Open your Excel workbook in WPS Spreadsheets and identify the paired X and Y data ranges.
- 2. Calculate the coefficients: Enter =SLOPE(E2:E11,D2:D11) in B1 and =INTERCEPT(E2:E11,D2:D11) in B2, replacing the example ranges with your data.
- 3. Enter the prediction formula: Place an input value in C2 and enter =$B$1*C2+$B$2 in an empty output cell.
- 4. Fill the output cells: Select the formula cell and drag its fill handle down to calculate results for the other input values in column C.

Frequently Asked Questions
Why does my formula result differ from the chart equation?
The chart may display rounded coefficients. Use SLOPE and INTERCEPT for full-precision values, and check that the formulas use the same data as the chart's linear series.
Why are there dollar signs in the coefficient references?
In =$B$1*C2+$B$2, the dollar signs keep B1 and B2 fixed when you drag the formula down, while C2 changes to the next input row.
Can I use these formulas for a polynomial trendline?
No. SLOPE and INTERCEPT produce coefficients for a standard linear relationship. A polynomial trendline requires additional coefficients and a different formula.
What if my chart's trendline has a fixed intercept?
The standard INTERCEPT formula calculates the intercept from the data, so it may not match a chart trendline configured with a fixed intercept. Use a regression calculation that applies the same intercept constraint.




