Contact

FORECAST.LINEAR in Excel: Fitted Values, Extrapolation and Paired Inputs

Statistical Intermediate Microsoft Excel

Calculate Excel linear forecasts from transparent coefficients, preserve irregular X spacing and distinguish fitted values from certainty about future outcomes.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: FORECAST.LINEAR(x,known_ys,known_xs) evaluates the fitted straight line at a chosen X. It can interpolate within observed X values or extrapolate beyond them, but neither operation guarantees the actual outcome.

Availability and version history

  • Introduced: Microsoft documents FORECAST.LINEAR replacing FORECAST in Excel 2016; the function catalogue also marks the new identity as a 2016 addition. An exact first build or preview date is not established.
  • Availability: official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
  • Checked: October 14, 2026; official FORECAST.LINEAR reference. Documentation and independent models; no native Excel execution or wider platform certification.

Syntax and lifecycle

=FORECAST.LINEAR(x,known_ys,known_xs)

All three arguments are required. The target X comes first, followed by observed Y and then observed X. Microsoft documents the equation a+b*x, with slope and intercept calculated from the paired data.

Microsoft introduced this identity as the replacement for FORECAST in Excel 2016. The older spelling remains available for compatibility; a recommendation to use the newer name does not make every forecasting-related function interchangeable.

The formula fits a straight line. It does not discover seasonal structure or return a prediction interval.

Example 1: evaluate a transparent line fit

Enter X 0,1,2,3 in A2:A5 and Y 10,13,12,17 in B2:B5:

=FORECAST.LINEAR(4,B2:B5,A2:A5)

Expected result: 18. Mean X is 1.5 and mean Y is 13. Centered paired products total 10, while centered X squares total 5. Slope is 2 and intercept is 13-2*1.5=10, so the fitted line is Y=10+2*X.

The last observation is 17 at X=3, but the line’s fitted value there is 16. The function does not simply add the last observed change to the last observation.

Example 2: interpolate within the observed range

=FORECAST.LINEAR(1.5,B2:B5,A2:A5)

Expected result: 13. This target lies inside the observed X interval. It also equals mean X, and the intercept-containing fitted line passes through the pair of sample means.

At X=1 the fitted value is 12, while the observed Y is 13. Even at an observed X, a least-squares line generally does not reproduce every noisy observation exactly.

INTERCEPT and SLOPE provide separate coefficient checks. Using their expected values, 10+2*1.5 reproduces 13.

Advanced example: fill several targets without moving the data

Put targets -1,0,1.5,4,6 in D2:D6. In E2 enter:

=FORECAST.LINEAR(D2,$B$2:$B$5,$A$2:$A$5)

Fill down. Expected fitted values are 8,10,13,18,22. The absolute references retain the same training data while the target changes.

Targets -1,4 and 6 lie outside the original interval 0 through 3. Label them as extrapolations; the straight line continues mathematically, but an underlying process may not continue in that way.

Advanced example: preserve irregular X spacing

Use a separate table with X 0,2,5,9 and Y 10,14,20,28. These values follow Y=10+2*X exactly.

At target X=6, expected FORECAST.LINEAR is 22. Substituting row positions 1,2,3,4 for those X values would fit a different model. A row number is not automatically the correct time, distance or exposure variable.

Keep actual independent-variable values and their units. If X represents elapsed time, define its origin and scale rather than relying on a display label.

Advanced check: a consistent shift of origin

For the original fixture, add 100 to all observed X values and use target 104. The slope stays 2 and the intercept becomes -190. Expected result remains 18.

Keeping target 4 while shifting only the observed X values would instead evaluate a different, distant X and give -182. Transform the target and observations consistently when changing coordinates.

Documented errors and remaining limits

Microsoft specifies #VALUE! for nonnumeric target X, #N/A for an empty observed series or unequal data-point counts, and #DIV/0! when observed X variance is zero.

The dedicated reference does not give a complete mixed-type observation matrix. All worked data here are numeric and paired. Missing records, error-containing ranges and extreme magnitudes need native testing. A successful numeric output is a fitted value, not evidence that the data quality or forecasting assumptions are sound.

References and verification

Expected outputs are independent mathematical calculations or explicitly documented rules, not captured native Excel results. Examples use fictional data, English function names and comma separators. Native floating-point boundaries remain untested.