FORECAST in Google Sheets: Linear Predictions and Fixed Training Ranges
Calculate Google Sheets fitted values from explicit paired data, preserve actual X spacing and keep interpolation distinct from a guarantee of future outcomes.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: FORECAST(x,data_y,data_x) estimates a Y value at a specified X using a fitted linear regression. The target comes first, followed by the observed Y and X ranges.
Availability and version history
- Introduced: first introduction date is not established by the reviewed official history; no desktop release number is inferred.
- Availability: documented in the rolling Google Sheets service; these examples use the web worksheet workflow.
- Checked: October 14, 2026; official FORECAST reference. Documentation and independent models, with no native Sheets execution or wider client certification.
Syntax and Google naming
=FORECAST(x,data_y,data_x)
All three arguments are required. Google documents text exclusion but does not provide a complete native-error or mixed-type matrix in the dedicated body reviewed.
The Google function catalogue directs FORECAST.LINEAR to FORECAST. That naming relationship is Google-specific evidence; it does not establish Microsoft’s Excel introduction or future-deprecation history for Sheets. FORECAST is currently documented here without a retirement claim.
The independently calculated examples use ordinary least-squares Y=a+b*X with complete numeric pairs. They are model outputs, not observed native captures or assurances about future data.
Example 1: predict from four paired observations
Enter this table in A1:B5:
| X | Y |
|---|---|
| 0 | 8 |
| 2 | 10 |
| 4 | 15 |
| 6 | 15 |
=FORECAST(8,B2:B5,A2:A5)
Expected result: 18.5. The means are X=3 and Y=12. Centered paired products total 26, while squared X deviations total 20. Slope is 1.3 and intercept is 12-1.3*3=8.1.
The fitted line is Y=8.1+1.3*X. It uses all four pairs, including the two final equal Y values. Merely repeating the last observed value 15 would be a different forecasting rule.
Example 2: interpolate at the mean X
=FORECAST(3,B2:B5,A2:A5)
Expected result: 12. The target lies inside the observed interval 0 through 6 and equals mean X. The fitted intercept-containing line passes through the pair of means.
At observed X=2, the fitted result is 10.7, not the observed 10. A regression line need not pass through every noisy point, even when the requested X is already in the data.
INTERCEPT and SLOPE provide separate coefficient checks for the same numeric model.
Advanced example: evaluate a target grid
Enter targets -2,0,3,6,8 in D2:D6. Put this in E2 and fill down:
=FORECAST(D2,$B$2:$B$5,$A$2:$A$5)
Expected results are 5.5,8.1,12,15.9,18.5. The fixed references preserve one fitted dataset while the target changes.
The targets -2 and 8 are extrapolations outside the observed X interval. The line extends mathematically, but a process may change direction or stop following the same relationship beyond the observed data.
Advanced example: unequal X spacing must stay unequal
Use a separate table with X 0,1,4,10 and Y 5,8,17,35. These pairs follow the exact line Y=5+3*X.
At X=6, the independently expected forecast is 23. Replacing the actual X values with row positions 1,2,3,4 fits a different model and no longer represents these unequal intervals.
If X represents elapsed time, distance or exposure, preserve that actual variable and its units. A row count is not automatically an equivalent independent variable.
Advanced check: change the origin consistently
For the first fixture, add 100 to each X and also change target 8 to 108. Slope stays 1.3, intercept becomes -121.9, and the expected forecast remains 18.5.
If only the observed X values are shifted and the target remains 8, the same line evaluates to -111.5. Both formulas can be numerically valid while describing completely different coordinates.
Adding 20 to each original Y raises the forecast at X=8 from 18.5 to 38.5. Multiplying Y by two instead gives 37. Coordinate and unit changes should be recorded alongside a report.
Errors and interpretation limits
Constant X makes the mathematical slope denominator zero. The Google reference reviewed does not assign an exact native error label for that condition, empty arrays, unequal shapes or nonnumeric targets. Those results are not imported from Excel’s documentation.
FORECAST returns a fitted point, not a seasonal model, causal explanation or uncertainty interval. Inspect residuals and the underlying record preparation before treating a plausible-looking number as a reliable prediction.
References and verification
Examples use fictional data, English function names and comma separators. Expected outputs are independent mathematical calculations or explicitly documented rules, not native Sheets captures. Check the spreadsheet locale when reproducing punctuation-sensitive formulas.