INTERCEPT
Returns the y-intercept of the linear regression line for paired data.
INTERCEPT fits y = m*x + b and returns b, the predicted y when x = 0.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=INTERCEPT(known_ys, known_xs)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
known_ys | number (range) | Required | — |
known_xs | number (range) | Required | — |
Remarks
known_yandknown_xmust have the same numeric length.
Error cases
- Returns
#N/Afor mismatched lengths. - Returns
#DIV/0!if allxvalues are identical.
Examples
Describe a linear fit between paired x and y observations.
Formula =INTERCEPT({2,5,6,9},{1,2,3,4})
Expected result 0
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Reverse the order of the y series while leaving x unchanged.
Formula =INTERCEPT({9,6,5,2},{1,2,3,4})
Expected result 11
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Evaluate a series whose observations lie exactly on a line.
Formula =INTERCEPT({2,4,6},{1,2,3})
Expected result 0
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The known x and y series must contain corresponding observations.
Formula =INTERCEPT({2,5,6,9},{1,2,3})
Expected result #N/A
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Positive intercept from direct arrays
Formula =INTERCEPT({3,5,7},{1,2,3})
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Intercept from range-based linear trend
Formula =INTERCEPT(A1:A3,B1:B3)
| A | B | |
|---|---|---|
| 1 | 10 | 1 |
| 2 | 8 | 2 |
| 3 | 6 | 3 |
Expected result 12
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.