Skip to content
YTutorby Yilmaz
EnglishEN

Topic 15 of 15, EHL Maths & Excel final (AP)

y=

Line equation from 2 points

With two known points you can find the straight line y = m*x + c. In Excel, SLOPE gives the slope m and INTERCEPT gives the intercept c. Put both outside the table, lock them with $, and every missing y and every missing x follows with one formula each.

When the exam asks for it

  • “linear relationship”, “two known points”, “find the equation”, “y is missing”, “x is missing”

Formulas

1) Slope m, outside the table in E2=SLOPE($B$2:$B$3, $A$2:$A$3)
2) Vertical intercept c, outside the table in E3=INTERCEPT($B$2:$B$3, $A$2:$A$3)
Missing yy = $slope$*x + $intercept$
Missing y in Excel, then fill down=$E$2*A4 + $E$3
Missing xx = (y - $intercept$) / $slope$
Missing x in Excel, then fill down=(B10 - $E$3) / $E$2

Worked example

B4fx=$E$2*A4 + $E$3
ABCDEF
1ProductPrice
20CHF 100.00slope (m)5
325CHF 225.00Vertical intercept (c)100
450y is missing → CHF 350.00
575y is missing → CHF 475.00
6100y is missing → CHF 600.00
7125y is missing → CHF 725.00
8150y is missing → CHF 850.00
9175y is missing → CHF 975.00
10x is missing → 180CHF 1,000.00
11x is missing → 200CHF 1,100.00
12
Sheet1
⬇ Download practice ExcelExample, Practice and Answers sheets with working formulas. Free.

Step by step

  1. =SLOPE($B$2:$B$3, $A$2:$A$3)in E2: (225 - 100) / (25 - 0) = 5
  2. =INTERCEPT($B$2:$B$3, $A$2:$A$3)in E3: 100 (the price when the product is 0)
  3. Equationy = 5x + 100
  4. =$E$2*A4 + $E$3missing y in B4: 5*50 + 100 = 350; fill down to B9 → 475, 600, 725, 850, 975
  5. =(B10 - $E$3) / $E$2missing x in A10: (1,000 - 100) / 5 = 180; fill down → (1,100 - 100) / 5 = 200

⚠ Exam traps

  • SLOPE and INTERCEPT take the y values first, then the x values.
  • Lock $E$2 and $E$3 before filling down, otherwise the formula moves away from the slope and the intercept.
  • Missing x: subtract the intercept first, then divide by the slope: (y - $intercept$) / $slope$. y / slope - intercept is wrong.
  • Use only the two known points in SLOPE and INTERCEPT, not the empty rows.
Practice question

Points (1, 20) and (5, 60). What is the equation, and which x gives y = 100?

Show answer

✓ Slope = (60-20)/(5-1) = 10, intercept = 20 - 10*1 = 10, so y = 10x + 10. x = (100 - 10) / 10 = 9.

Stuck on this topic before your exam? We explain it one-to-one on your own Excel files, live online. Short crash courses before the EHL Maths & Excel final are possible on weekdays and weekends.

Book a lesson

Tell us your course, your exam date and the topics that worry you. We start with what matters most for your grade.

Send a message

We answer by email or WhatsApp.

Give your email or your WhatsApp number (or both) so we can answer you.

← Pass AP guide← Pass AP
WhatsApp