ONLYOFFICE FORECAST.LINEAR: Linear Predictions, Units and Examples
Predict a response with ONLYOFFICE FORECAST.LINEAR, verify the fitted coefficients, and avoid mismatched predictor units and unsupported extrapolation.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =FORECAST.LINEAR(7,B2:B5,A2:A5) returns an independently expected 12.3 for the paired data below. It evaluates a straight-line regression at x=7, using y-values first and x-values second in the two training ranges.
Availability and version history
- Introduced: The first introduction release and date are not established by the checked sources.
- Availability: Currently documented in ONLYOFFICE’s rolling function help; no final supported-version endpoint is established.
- Scope: Shared Spreadsheet Editor documentation. Exact availability in individual Docs, Desktop and mobile builds is not established by this page.
- Checked: October 14, 2026, against the official FORECAST.LINEAR reference. Examples were independently calculated and compared with the vendor screenshot; these cases were not tested in the native application.
Exact syntax
=FORECAST.LINEAR(x, known_y's, known_x's)
The official entry describes prediction by linear regression. Supply all three arguments: the requested x-value, the known y-values and the known x-values. Keep the training arrays aligned and equally sized, as a set of paired observations.
The dot is part of the function name. There is no optional confidence argument or automatic seasonal model in this signature. A date or period is useful only through the numeric predictor values supplied; the function does not infer a business calendar from a nearby label.
A complete interpolation worksheet
Create a blank sheet named LinearPrediction. Put Input level and Response in A1:B1. Enter:
| Row | A: x | B: y |
|---|---|---|
| 2 | 2 | 5 |
| 3 | 4 | 9 |
| 4 | 6 | 10 |
| 5 | 8 | 14 |
Keep result labels in G and enter these values or formulas in H:
| Cell | Entry | Independent target |
|---|---|---|
| H2 | 7 |
7 |
| H3 | =FORECAST.LINEAR(H2,B2:B5,A2:A5) |
12.3 |
| H4 | =SLOPE(B2:B5,A2:A5) |
1.4 |
| H5 | =INTERCEPT(B2:B5,A2:A5) |
2.5 |
| H6 | =H5+H4*H2 |
12.3 |
The fitted equation is y=2.5+1.4x. In this example x=7 lies between observed inputs 6 and 8, but the line uses all four pairs. It is not just the straight segment connecting the last two observations, which would give 12 instead.
Put Fitted response and Residual in C1:D1. Enter =FORECAST.LINEAR(A2,$B$2:$B$5,$A$2:$A$5) in C2 and =B2-C2 in D2. Fill C2:D2 through row 5. Expected fitted responses are 5.3, 8.1, 10.9, 13.7; residuals are -0.3, 0.9, -0.9, 0.3.
The mean x is 5 and mean y is 9.5; the fitted line passes through that point. These identities follow the ordinary least-squares formulas, providing a separate mathematical check on the results.
Advanced: changing predictor units without changing the prediction
Leave A:H intact. Put Rescaled x in J1 and =A2*100 in J2; fill to J5. The training predictor now uses units one hundredth as large, so the requested x=7 must become 700.
Put =FORECAST.LINEAR(700,B2:B5,J2:J5) in N2; expect 12.3. Put =SLOPE(B2:B5,J2:J5) in N3; expect 0.014. The intercept remains 2.5 because multiplying the predictor by a positive factor does not move its zero point.
As a deliberate incorrect-unit control, put =FORECAST.LINEAR(7,B2:B5,J2:J5) in N4; its mathematical target is 2.598, not 12.3. The function cannot know that the new x was entered in the old unit. Consistent units matter even when the formula returns a plausible number without an error.
Prediction outside the measured range
Create a separate sheet named PredictionPoints. Put 0, 5, 7, 10 in A2:A5. In B2 enter:
=FORECAST.LINEAR(A2,LinearPrediction!$B$2:$B$5,LinearPrediction!$A$2:$A$5)
Fill B2 through B5. Expected results are 2.5, 9.5, 12.3 and 16.5. Inputs 0 and 10 are outside the observed range 2–8. These are values of the fitted line, not observations demonstrating that the relationship continues there.
Keep the model’s intended range, measurement units and practical constraints visible. A single straight line cannot automatically handle saturation, thresholds or a curve. This formula does not return a confidence interval, and a small residual within the training data does not guarantee future accuracy.
Check the vendor’s example independently
On a new sheet named VendorLinear, enter A1:B5 without headers as 1,78; 56,74; 5,13; 7,17; 19,60, with each pair occupying one row. A is known y and B is known x here.
Enter =FORECAST.LINEAR(50,A1:A5,B1:B5) in D2. The official screenshot displays 18.12721. An independent least-squares calculation gives approximately 18.127214995, using an intercept of 1.651746389 and slope of 0.329509372.
Troubleshooting and related functions
Use numeric, complete pairs with varying known x-values. Confirm the requested x uses the same units as the training x-range and that fill-down does not move the fixed training ranges. The brief official entry does not establish every exact error, coercion rule or supported historical client build.
FORECAST is also currently documented and has the same displayed vendor example. The checked ONLYOFFICE pages do not declare one name retired. SLOPE and INTERCEPT expose the fitted coefficients; RSQ helps describe linear fit without establishing causation or future reliability.