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 y
y = $slope$*x + $intercept$Missing y in Excel, then fill down
=$E$2*A4 + $E$3Missing x
x = (y - $intercept$) / $slope$Missing x in Excel, then fill down
=(B10 - $E$3) / $E$2Worked example
B4fx
=$E$2*A4 + $E$3| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Product | Price | ||||
| 2 | 0 | CHF 100.00 | slope (m) | 5 | ||
| 3 | 25 | CHF 225.00 | Vertical intercept (c) | 100 | ||
| 4 | 50 | y is missing → CHF 350.00 | ||||
| 5 | 75 | y is missing → CHF 475.00 | ||||
| 6 | 100 | y is missing → CHF 600.00 | ||||
| 7 | 125 | y is missing → CHF 725.00 | ||||
| 8 | 150 | y is missing → CHF 850.00 | ||||
| 9 | 175 | y is missing → CHF 975.00 | ||||
| 10 | x is missing → 180 | CHF 1,000.00 | ||||
| 11 | x is missing → 200 | CHF 1,100.00 | ||||
| 12 |
Sheet1
⬇ Download practice ExcelExample, Practice and Answers sheets with working formulas. Free.
Step by step
=SLOPE($B$2:$B$3, $A$2:$A$3)in E2: (225 - 100) / (25 - 0) = 5=INTERCEPT($B$2:$B$3, $A$2:$A$3)in E3: 100 (the price when the product is 0)- Equationy = 5x + 100
=$E$2*A4 + $E$3missing y in B4: 5*50 + 100 = 350; fill down to B9 → 475, 600, 725, 850, 975=(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.
WhatsApp is preferred
The fastest way to book: send us a message and we usually answer the same day.

or email info@ytutor.net
Send a message
We answer by email or WhatsApp.