ONLYOFFICE FORECAST: Predict Values and Check a Fitted Line
Use ONLYOFFICE FORECAST with complete cost data, fixed training ranges, interpolation and extrapolation checks, and a reproducible official example.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =FORECAST(6,B2:B6,A2:A6) predicts 20.9 for the cost data below. The first argument is the x-value at which to evaluate the fitted relationship; it is not a number of future rows to generate.
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 reference. Examples were independently calculated and compared with the vendor screenshot; these cases were not tested in the native application.
Syntax and required inputs
=FORECAST(x, known_y's, known_x's)
Supply the new predictor x, the observed dependent y-values and their paired independent x-values. The official reference requires equal numbers of known x and y elements. All three positions are supplied; there is no optional confidence level, seasonality setting or forecast horizon in this signature.
The following numeric examples reconstruct the prediction as intercept plus slope times x and agree with the vendor’s worked screenshot. They do not establish every coercion or error boundary in the native product.
Predict a cost from five observations
Create a blank sheet named CostForecast. Put Batch size in A1 and Cost in B1. Enter the following illustrative data in A2:B6. Keep both columns numeric and retain each pair on the same row.
| Row | A: batch size | B: cost |
|---|---|---|
| 2 | 1 | 10 |
| 3 | 2 | 12 |
| 4 | 3 | 13 |
| 5 | 4 | 15 |
| 6 | 5 | 20 |
Use G for labels. Enter 6 in H2 as the new batch size, then enter:
| Cell | Formula | Independent expected result |
|---|---|---|
| H3 | =FORECAST(H2,B2:B6,A2:A6) |
20.9 |
| H4 | =SLOPE(B2:B6,A2:A6) |
2.3 |
| H5 | =INTERCEPT(B2:B6,A2:A6) |
7.1 |
| H6 | =H5+H4*H2 |
20.9 |
The coefficient 2.3 has cost units per batch-size unit; the intercept 7.1 has cost units. It is a fitted baseline, not proof that a real zero-size order incurs that exact cost. Ordinary least-squares coefficient formulas are set out in the NIST reference.
Inspect the fitted observations before extending the line
Put Fitted cost and Residual in C1:D1. In C2 enter =FORECAST(A2,$B$2:$B$6,$A$2:$A$6) and in D2 enter =B2-C2. Fill C2:D2 through row 6.
| Row | Expected C | Expected D |
|---|---|---|
| 2 | 9.4 | 0.6 |
| 3 | 11.7 | 0.3 |
| 4 | 14 | -1 |
| 5 | 16.3 | -1.3 |
| 6 | 18.6 | 1.4 |
The prediction need not equal an observed cost, even when x is one of the original values. The line balances the squared discrepancies across all five observations; it does not simply look up the nearest row.
The absolute references keep the training ranges fixed. Leaving those ranges relative during fill-down would progressively replace the dataset, potentially adding blanks and omitting early observations.
Advanced: compare interpolation with extrapolation
Keep A:H unchanged. Put New size, Prediction and Linear check in J1:L1. Enter 2.5, 6, 10 in J2:J4. Enter =FORECAST(J2,$B$2:$B$6,$A$2:$A$6) in K2 and =$H$5+$H$4*J2 in L2. Fill K2:L2 through row 4.
Expected pairs are 12.85, 20.9 and 30.1. Size 2.5 is within the observed range; sizes 6 and 10 extend beyond it. The same algebra generates all three, but observations at sizes 1–5 alone do not verify how costs behave at size 10.
A bulk discount, capacity limit or fixed setup policy could invalidate the straight-line extension. Inspect residuals and the business process before using a forecast as a commitment. This function does not supply a prediction interval or a guarantee.
Reproduce ONLYOFFICE’s screenshot
On another blank sheet named VendorForecast, enter the following A1:B5 block without headers. In this example A contains y-values and B contains x-values, matching the vendor’s argument order.
| A: known y | B: known x |
|---|---|
| 1 | 78 |
| 56 | 74 |
| 5 | 13 |
| 7 | 17 |
| 19 | 60 |
Enter =FORECAST(50,A1:A5,B1:B5) in D2. The screenshot shows 18.12721; independent regression gives approximately 18.127214995. Its fitted intercept is approximately 1.651746389 and slope 0.329509372. Do not swap the arguments merely because x is commonly placed in column A in other examples.
Compatibility, errors and related functions
ONLYOFFICE currently documents both FORECAST and FORECAST.LINEAR. Their published numeric screenshot examples agree, but the checked ONLYOFFICE entries do not label FORECAST retired or prescribe a mandatory replacement. A naming or deprecation policy from another spreadsheet should not be imported here.
Check equal range lengths, numeric x-values and variation in known x before investigating unexpected results. The short FORECAST entry does not specify every exact error code, empty-cell rule or text-coercion case. Use complete numeric pairs rather than assuming missing observations will be handled as you intend.
INTERCEPT and SLOPE help explain the fitted equation. STEYX measures residual spread; it is not itself an upper or lower bound for a new forecast.