WorkbookLogic
FunctionStatisticaladvancedFORECAST.LINEARSLOPEINTERCEPTFORECASTIFABS

FORECAST.LINEAR Function

By WorkbookLogic

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.

ExcelLast reviewed Sep 11, 2026
forecast-linear-function-v1.0.0.xlsx
Excel FORECAST.LINEAR Function
FORECAST.LINEAR predicts a y-value at a chosen x-value from a least-squares straight-line fit.
Source data, editableExamples
Known xKnown yTargetx valueExampleFormula syntaxResult
1.012.0Forecast target8.0Forecast at x = 8=FORECAST.LINEAR(D12,B12:B17,A12:A17)36.1
2.015.0Interpolation target4.5Interpolate x = 4.5=FORECAST.LINEAR(D13,B12:B17,A12:A17)24.0
3.019.0Slope + intercept=SLOPE(B12:B17,A12:A17)*D12+INTERCEPT(B12:B17,A12:A17)36.1
4.022.0Legacy equivalent=FORECAST(D12,B12:B17,A12:A17)36.1
5.026.0
6.029.0
Reliability checks
FORECAST.LINEAR equals slope times x plus interceptOK
The legacy FORECAST name returns the same predictionOK

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 #N/A.

Non-numeric target

Returns #VALUE!.

Constant known x-values

Returns #DIV/0! because x variance is zero.

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.