Quick Answer

FORECAST Function

Predicts a y-value from a linear regression at a given x.

✓ Excel✓ Google SheetsExcel All versions

Syntax

FORECAST
(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(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(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 FORECAST.LINEAR

Legacy vs modern name

Both return the same prediction

=FORECAST(6,{2,3,5,7,11},{1,2,3,4,5}) and =FORECAST.LINEAR(6,{2,3,5,7,11},{1,2,3,4,5})
Result: 12.2 for both
FORECAST.LINEAR is the renamed, recommended form of the legacy FORECAST.

How FORECAST Works

FORECAST fits a straight line y = a + bx by least squares, where the slope b = Σ((x - x̄)(y - ȳ)) / Σ(x - x̄)² and the intercept a = ȳ - b·x̄. It then evaluates that line at the supplied x. The prediction is purely linear and assumes the underlying relationship is roughly straight.

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(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 with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the FORECAST 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 the same as FORECAST.LINEAR?
Yes. FORECAST.LINEAR is the modern name; in current Excel they return the same value.
Can FORECAST predict backwards (x smaller than the data)?
Yes. It simply evaluates the fitted line at any x, including outside the original range.
How is this different from TREND?
FORECAST returns a single predicted y; TREND can return an entire array of predictions at once.