FORECAST.LINEAR Function
FORECAST.LINEAR predicts a y-value at a specified x-value from a least-squares straight-line fit through known observations. It can interpolate within or extrapolate beyond the known x-range.
| Excel FORECAST.LINEAR Function | |||||||||||
| FORECAST.LINEAR predicts a y-value at a chosen x-value from a least-squares straight-line fit. | |||||||||||
| Source data, editable | Examples | ||||||||||
| Known x | Known y | Target | x value | Example | Formula syntax | Result | |||||
| 1.0 | 12.0 | Forecast target | 8.0 | Forecast at x = 8 | =FORECAST.LINEAR(D12,B12:B17,A12:A17) | 36.1 | |||||
| 2.0 | 15.0 | Interpolation target | 4.5 | Interpolate x = 4.5 | =FORECAST.LINEAR(D13,B12:B17,A12:A17) | 24.0 | |||||
| 3.0 | 19.0 | Slope + intercept | =SLOPE(B12:B17,A12:A17)*D12+INTERCEPT(B12:B17,A12:A17) | 36.1 | |||||||
| 4.0 | 22.0 | Legacy equivalent | =FORECAST(D12,B12:B17,A12:A17) | 36.1 | |||||||
| 5.0 | 26.0 | ||||||||||
| 6.0 | 29.0 | ||||||||||
| Reliability checks | |||||||||||
| FORECAST.LINEAR equals slope times x plus intercept | OK | ||||||||||
| The legacy FORECAST name returns the same prediction | OK | ||||||||||
Overview
FORECAST.LINEAR predicts a numeric value from the straight line that best fits paired x and y observations.
Quick reference
Syntax: =FORECAST.LINEAR(x, known_ys, known_xs)
Returns: The fitted y-value at the supplied x-value. (number)
Arguments:
x(required) — Numeric x-value for the prediction.known_ys(required) — Dependent observations.known_xs(required) — Independent observations paired with known_ys.
All three arguments are required. known_ys and known_xs must contain the same number of numeric observations, while x is the point at which the fitted line is evaluated.
Common uses
- Predicting a value from a stable numeric trend
- Interpolating between known observations
- Comparing a direct forecast with slope-and-intercept calculations
Calculations
Excel fits a least-squares line through the paired observations, then evaluates that line at x. The calculation is equivalent to INTERCEPT(known_ys,known_xs)+SLOPE(known_ys,known_xs)*x.
The known ranges must be the same size and correctly paired. A target inside the observed x-range is an interpolation; a target outside it is an extrapolation.
Function behavior
Situation | Behavior |
|---|---|
Target inside known range | Interpolates on the fitted line. |
Target outside known range | Extrapolates the line beyond observed data. |
Unequal range sizes | Returns |
Non-numeric target | Returns |
Constant known x-values | Returns |
Common errors
Reversing x and y ranges
What happens: Excel models the opposite dependency.
Better approach: Put dependent observations in known_ys and explanatory observations in known_xs.
Treating extrapolation as certainty
What happens: The prediction assumes the past linear relationship continues outside observed data.
Better approach: Label extrapolations and consider whether the relationship remains plausible.
Example
Example 1
=FORECAST.LINEAR(D12,B12:B17,A12:A17)
For target x = 8, the workbook returns 36.1.
Example 2
=FORECAST.LINEAR(D13,B12:B17,A12:A17)
For x = 4.5, which lies inside the known range, the interpolated result is 24.0.
Example 3
=SLOPE(B12:B17,A12:A17)*D12+INTERCEPT(B12:B17,A12:A17)
Rebuilding the line equation returns the same 36.1 forecast.
Example workbook
The workbook includes six paired observations, forecast and interpolation targets, a line-equation reconstruction, a legacy-name comparison, and two OK checks.
Key takeaway
FORECAST.LINEAR evaluates a fitted straight line; keep x and y ranges aligned and distinguish interpolation from extrapolation.