Exceljet

Quick, clean, and to the point

Excel FORECAST.LINEAR Function

Excel FORECAST.LINEAR function
Summary 

The Excel FORECAST function predicts a value based on existing values along a linear trend. FORECAST calculates future value predictions using linear regression, and can be used to predict numeric values like sales, inventory, expenses, measurements, etc.

Note: Starting with Excel 2016, the FORECAST function was replaced with the FORECAST.LINEAR function. Microsoft recommends replacing FORECAST with FORECAST.LINEAR, since FORECAST will eventually be deprecated.

Purpose 
Predict value along a linear trend
Return value 
Predicted value
Syntax 
=FORECAST.LINEAR (x, known_ys, kown_xs)
Arguments 
  • x - The x value data point to use to calculate a prediction.
  • known_ys - The dependent array or range of data (y values).
  • kown_xs - The independent array or range of data (x values).
Version 
Usage notes 

The FORECAST.LINEAR function predicts a value based on existing values along a linear trend. FORECAST.LINEAR calculates future value predictions using linear regression, and can be used to predict numeric values like sales, inventory, test scores, expenses, measurements, etc.

Note: Starting with Excel 2016, the FORECAST function was replaced with the FORECAST.LINEAR function. Microsoft recommends replacing FORECAST with FORECAST.LINEAR, since FORECAST will eventually be deprecated.

In statistics, linear regression is an approach for modeling the relationship between a dependent variable (y values) and an independent variable (x values). FORECAST.LINEAR uses this approach to calculate a y value for a given x value based on existing x and y values. In other words, for a given value x, FORECAST.LINEAR returns a predicted value based on the linear regression relationship between x values and y values.

Example

In the example shown above, the formula in cell D13 is:

=FORECAST.LINEAR(B13,sales,periods)

where sales (C5:C12) and periods (B5:B12) are named ranges. With these inputs, the FORECAST.LINEAR function returns 1505.36 in cell D13. As the formula is copied down the table, FORECAST.LINEAR returns predicted values in D13:D16, using values in column B for x.

The chart to the right shows this data plotted in a scatter plot.

Notes

  • If x is not numeric, FORECAST.LINEAR returns a #VALUE! error.
  • If known_ys and known_xs are not the same size, FORECAST.LINEAR will return an #N/A error.
  • If the variance of known_x values is zero, FORECAST.LINEAR will return a #DIV/0! error.

Download 200+ Excel Shortcuts

Get over 200 Excel shortcuts for Windows and Mac in one handy PDF.