Function Problems

Find a Linear Equation and Calculate y in Excel

Huda QurayshiHuda Qurayshi Nov 18, 2026 870 views

Question details

Find the linear equation through three given points and calculate y when x is 12.5.

Find a Linear Equation and Calculate y in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Use the points (5, 1), (10, 3), and (15, 5) to determine a linear function and evaluate it at x = 12.5.
Observed behavior
The points lie on y = 0.4x - 1, which gives y = 4 when x = 12.5.
Before you start

Enter the x-values 5, 10, and 15 in cells A3:A5 and the corresponding y-values 1, 3, and 5 in B3:B5. Keep each point's x- and y-values on the same row.

Solution 1Recommended

Use SLOPE and INTERCEPT to calculate y in Excel

Calculate the coefficients from the three points, then evaluate the function at x = 12.5.

1
Calculate the slope

In an empty cell, enter =SLOPE(B3:B5,A3:A5). The result is 0.4.

2
Calculate the intercept

In another empty cell, enter =INTERCEPT(B3:B5,A3:A5). The result is -1, so the equation is y = 0.4x - 1.

3
Evaluate the equation

In an empty cell, enter =SLOPE(B3:B5,A3:A5)*12.5+INTERCEPT(B3:B5,A3:A5). The result is 4.

Use SLOPE and INTERCEPT to calculate y in Excel
Check the relationship: The three points fit this line exactly. For other data, SLOPE and INTERCEPT return a best-fit line, so inspect the points before assuming an exact linear relationship.
Calculate with WPS Spreadsheets

Find the linear equation in WPS Spreadsheets

Enter the points in WPS Spreadsheets and use SLOPE and INTERCEPT to calculate the equation and its value at x = 12.5.

  1. 1. Enter the points: Open WPS Spreadsheets and enter 5, 10, and 15 in A3:A5 and 1, 3, and 5 in B3:B5.
  2. 2. Find the slope: Select an empty cell and enter =SLOPE(B3:B5,A3:A5) to get 0.4.
  3. 3. Find the intercept: Select another empty cell and enter =INTERCEPT(B3:B5,A3:A5) to get -1.
  4. 4. Calculate y: In an empty cell, enter =SLOPE(B3:B5,A3:A5)*12.5+INTERCEPT(B3:B5,A3:A5) to get 4.
Calculate the slope and intercept with spreadsheet functionsEvaluate the linear equation for other x-valuesOpen and save Microsoft Excel XLSX filesUse a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

How is the equation y = 0.4x - 1 derived?

Using (5, 1) and (10, 3), the slope is (3 - 1) / (10 - 5) = 0.4. Substitute (5, 1) into y = 0.4x + b to get b = -1.

What is y when x is 12.5?

Substitute 12.5 into y = 0.4x - 1: y = 0.4 × 12.5 - 1 = 4.

Can I use LINEST to find the coefficients?

Yes. Enter =LINEST(B3:B5,A3:A5) in Excel to return the slope and intercept. In older versions, select two horizontal cells and confirm the formula with Ctrl+Shift+Enter.

How can I check whether other points follow a straight line?

Select the x- and y-value columns in Excel and choose Insert > Scatter to inspect the points. You can add a linear trendline to assess how closely they fit a line.