Category: FUNCTION | Updated: 2026-11-22
How to Use the FORECAST Function in Google Sheets | Predict Future Values with Linear Regression
Syntax
=FORECAST(x, data_y, data_x)
- x: The value on the x-axis to forecast (such as a future period or ad spend).
- data_y: The range representing the array or matrix of known dependent data (such as historical sales).
- data_x: The range representing the array or matrix of known independent data (such as past months or elapsed days).
Example with a Table
Here is an example of predicting June sales (A7) based on actual sales from January to May (A2:B6).
| Cell | A (Month) | B (Sales, $10k) | C (Formula) |
|---|---|---|---|
| 1 | Month | Sales ($10k) | Formula |
| 2 | 1 | 100 | |
| 3 | 2 | 120 | |
| 4 | 3 | 135 | |
| 5 | 4 | 155 | |
| 6 | 5 | 170 | |
| 7 | 6 | 188.0 | =FORECAST(A7, B2:B6, A2:A6) |
Based on the historical growth pace (about 17.5 per month), June sales are forecast at 188.0.
Common Errors and Notes
- Watch the argument order: Specify
data_y(e.g., sales) first anddata_x(e.g., month or date) second. Reversing them will produce a completely different forecast. #N/AError: Occurs ifdata_yanddata_xhave different range sizes or if the data is empty.#DIV/0!Error: Occurs if the variance ofdata_xis0(all values are the same).
Frequently Asked Questions
Q. What is the difference between FORECAST and FORECAST.LINEAR?
A. Their calculation results and functionality are identical. FORECAST.LINEAR is a newer function name that explicitly indicates linear forecasting, and using FORECAST.LINEAR is now recommended.
Q. Can it accurately predict data with seasonal fluctuations (such as higher sales only in summer)?
A. No, FORECAST fits a simple straight line (linear trend) to predict values, so it is not suitable for data with seasonal waves.