Contact

FORECAST in WPS Spreadsheet: Fit and Evaluate a Straight Line

Statistical Intermediate WPS Spreadsheet

Use fixed paired ranges to calculate a least-squares forecast, distinguish interpolation from extrapolation and verify slope and intercept independently.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

FORECAST evaluates a least-squares straight line at an x value you supply. The function’s name does not make the result a reliable prediction of a future event. It summarizes a specified linear model fitted to the supplied observations.

Syntax and argument order

=FORECAST(x, known_y_values, known_x_values)

The target x comes first, followed by the observed y range, then the observed x range. Keep the two observed ranges equal in size and preserve their pairings. The examples use complete numeric data with nonconstant x values.

Step-by-step original example

Enter A2:A4 as 1, 2, 3 and B2:B4 as 3, 5, 7. These pairs lie on y = 1 + 2x.

  1. Enter =FORECAST(4,$B$2:$B$4,$A$2:$A$4) in D2. The independent expected value is 9.
  2. Change only the first argument to 0. The expectation is 1, the line’s intercept.
  3. Change it to 2.5. The expectation is 6, an interpolation inside the observed x range.

Dollar signs keep the observed ranges fixed when a formula is copied. Without them, copying can change the fitted dataset as well as the target, producing a different calculation rather than another point on the same line.

Verify the fitting arithmetic

For paired data, independently calculate the slope as the sum of (x − mean_x)*(y − mean_y) divided by the sum of (x − mean_x)^2. The intercept is mean_y − slope*mean_x. The output is intercept + slope*target_x.

For x = 1, 2, 3 and y = 2, 3, 7, the means are 2 and 4. The centered cross-product sum is 5 and the x squared-deviation sum is 2. Thus slope = 2.5, intercept = −1, and the expected value at x = 4 is 9. At x = 2 it is 4.

Observed y, with x = 1, 2, 3 Target x Independent expectation
3, 5, 7 4 9
3, 5, 7 0 1
3, 5, 7 2.5 6
2, 3, 7 4 9
2, 3, 7 2 4
7, 5, 3 4 1

Examine residuals before extrapolating

For the imperfect dataset 2, 3, 7, fitted values at the observed x values are 1.5, 4 and 6.5. Observed-minus-fitted residuals are 0.5, −1 and 0.5, with squared sum 1.5. These arithmetic checks reveal that the line does not pass through every observation, even though its forecast at 4 happens to equal the perfect-line example’s forecast.

Targets 0 and 4 are outside the observed range 1 through 3. Such extrapolation needs substantive justification about the data-generating process. This function alone supplies neither a prediction interval nor evidence that trends persist. See INTERCEPT for the constant term and CORREL for standardized linear association.

Official demonstration and errors

The WPS 2019 walkthrough initially uses x = 1, 2, 3, 4 and sales 1223, 1210, 2225, 1352. Its first target 5 gives 1853. Independent arithmetic gives slope 140.2 and intercept 1152, reproducing that first result. The shown formula uses relative observed ranges; later filled rows move those ranges. They should not be read as repeated evaluations of one unchanged regression.

The lesson documents #VALUE! for nonnumeric target x, #N/A for empty or unequal-sized observed arrays, and #DIV/0! when x has zero variance. Original controls here do not exercise those errors or mixed-value omission. When troubleshooting, first check y/x argument order, equal-sized paired ranges, fixed references and variability in the x observations.

Availability and evidence scope

The official WPS lesson is dated 2019-05-13. The lesson explicitly applies to WPS Office for Windows Personal. Its walkthrough explicitly names WPS 2019. A numeric build is not specified. The lesson date is a documented-by date, not a first-release date. First introduction, last functioning version and retirement or deprecation history remain unestablished. No cross-platform parity is inferred.

The complete lesson and its formula images or walkthrough were inspected on October 18, 2026. Original examples in this guide were independently calculated from the documented model; they were not executed in WPS or another spreadsheet engine. Historical vendor demonstrations are identified separately. Numeric approximations below are independent expectations, not promises about WPS display precision.