FORECAST.LINEAR Function

Excel 2016+, Excel for Microsoft 365

Summary

The FORECAST.LINEAR function predicts a future value using simple linear regression analysis. It calculates the best-fit straight line through known data points and extends it to estimate values for new x-values, making it ideal for trend analysis and basic forecasting.

Syntax

FORECAST.LINEAR(x, known_y's, known_x's)

Parameters

Parameter Type Required Description
x Number Yes Target x-value for prediction
known_y's Range/Array Yes Dependent variable data points
known_x's Range/Array Yes Independent variable data points

Using the FORECAST.LINEAR Function

FORECAST.LINEAR fits a straight line to historical data using the least squares method and predicts future values. It's perfect for sales forecasting, trend projection, and any scenario where data shows a consistent linear pattern over time.

Common FORECAST.LINEAR Examples

Basic Sales Forecast

=FORECAST.LINEAR(13, B2:B12, A2:A12)

Predicts next month's sales (month 13) based on 12 months of historical sales data.

Temperature Prediction

=FORECAST.LINEAR(75, C2:C20, B2:B20)

Estimates temperature at 75 degrees longitude based on existing weather data points.

Budget Projection

=FORECAST.LINEAR(E5, SalesData[Amount], SalesData[Month])

Projects budget needs for target month E5 using structured sales table.

Frequently Asked Questions

FORECAST.LINEAR is the modern name. FORECAST still works for backward compatibility but FORECAST.LINEAR is recommended.

Use nonlinear forecasting functions like FORECAST.ETS for seasonal or exponential patterns.

Ranges should contain complete paired data. Remove or interpolate missing values first.

Common Errors and Solutions

#VALUE! error

Cause: x is not numeric, or known_y's and known_x's arrays have different sizes

Solution: Ensure all inputs are numeric and arrays match in size

#N/A error

Cause: known_x's array doesn't contain the x value

Solution: Verify x falls within or extends known_x's range logically

Inconsistent array sizes

Cause: known_y's and known_x's have different numbers of elements

Solution: Match array dimensions exactly

Notes

  • Performs y = mx + b linear regression where m = slope, b = y-intercept
  • Assumes perfect linear relationship (R²=1 would be perfect fit)
  • x should logically extend beyond known_x's for true forecasting
  • Same algorithm as Excel's TREND function for single predictions

Compatibility

Available in: Excel 2016, Excel 2019, Excel 2021, Excel for Microsoft 365

Not available in: Excel 2013 and earlier versions

Content last reviewed: December 9, 2025
Update frequency: As needed
Excel versions tested: Excel 2016+, Excel for Microsoft 365