Quick Answer

FORECAST.LINEAR Function

Predicts a y-value from a linear regression at a given x (Excel 2016+).

✓ Excel✓ Google SheetsExcel Excel 2016+

Syntax

FORECAST.LINEAR
(x, known_ys, known_xs)

Parameters

ParameterDescriptionRequired
xThe x-value at which to predict the corresponding y-value.Required
known_ysThe dependent (y) values of the known data used to fit the line.Required
known_xsThe independent (x) values of the known data; must match the size of known_ys.Required

Basic Example

Predict the next value on a rising trend

=FORECAST.LINEAR(6,{2,3,5,7,11},{1,2,3,4,5})
Result12.2

The fitted line is y = -1 + 2.2x, so at x=6 the prediction is -1 + 2.2*6 = 12.2.

Advanced Examples

Example 1: Forecast from worksheet ranges

Project next month's revenue

Use a column of past revenues and a column of period numbers

=FORECAST.LINEAR(13,B2:B12,A2:A12)
Result: Predicted revenue for period 13
Least-squares line through the 11 points is extended to x=13.

Example 2: Equivalence to legacy FORECAST

Modern vs legacy name

Both return the same prediction

=FORECAST.LINEAR(6,{2,3,5,7,11},{1,2,3,4,5}) and =FORECAST(6,{2,3,5,7,11},{1,2,3,4,5})
Result: 12.2 for both
FORECAST.LINEAR replaced FORECAST but computes identically.

How FORECAST.LINEAR Works

FORECAST.LINEAR fits a straight line y = a + bx by least squares, with slope b = Σ((x - x̄)(y - ȳ)) / Σ(x - x̄)² and intercept a = ȳ - b·x̄, then evaluates that line at x. It is the modern, clearly named form of the legacy FORECAST function.

1
List known data
Place known x-values and known y-values in equal-length ranges.
2
Pick target x
Decide the x at which you want a prediction.
3
Enter formula
Type =FORECAST.LINEAR(x, known_ys, known_xs).

Important Notes & Limitations

  • Models only a linear relationship; curved trends need TREND/GROWTH or transforms.

  • known_xs and known_ys must have the same number of points, or #N/A is returned.

  • If the x-values have no variance (all equal), the function returns #DIV/0!.

Common Errors & Fixes

#N/Aknown_xs and known_ys have different sizes, or a non-numeric x was supplied.

Fix: Make the two arrays the same length and pass a numeric x.

#DIV/0!All known_xs values are identical, so the slope is undefined.

Fix: Provide x-values that actually vary.

Download Practice File

Practice FORECAST.LINEAR with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the FORECAST.LINEAR function. Works in both Excel and Google Sheets.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

Is FORECAST.LINEAR the same as FORECAST?
Yes. FORECAST.LINEAR is the modern name for the same calculation as the legacy FORECAST.
Which should I use in new work?
Use FORECAST.LINEAR; FORECAST is retained only for backward compatibility.
How is this different from TREND?
FORECAST.LINEAR returns a single predicted y; TREND can return an entire array of predictions at once.