Contact

FORECAST Function (Gnumeric)

Statistical Intermediate Gnumeric

Learn the FORECAST function in Gnumeric: Returns a value along a linear regression.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Gnumeric. How formula examples are checked

What FORECAST does

Gnumeric’s FORECAST estimates a y-value for a supplied x-value by fitting a straight line to paired numeric observations. The fitted line has the form:

[\widehat{y}=a+bx,\qquad b=\frac{\sum_i(x_i-\bar{x})(y_i-\bar{y})}{\sum_i(x_i-\bar{x})^2},\quad a=\bar{y}-b\bar{x}.]

Here b is the slope and a is the intercept. The function is appropriate for an introductory straight-line forecast, not a guarantee of causal relationships or real-world future performance. Gnumeric’s Statistics manual explicitly documents the function as simple linear regression; GNOME’s source computes a linear regression and applies its intercept and slope to x. [S1, S3]

Exact Gnumeric syntax and argument order

=FORECAST(x,known_ys,known_xs)
Argument Required? Type / purpose Default
x Yes Numeric explanatory x-value at which the prediction is wanted None
known_ys Yes Range containing dependent y-values (responses or measurements) None
known_xs Yes Corresponding range containing independent x-values (times, inputs, or explanatory values) None

The order is forecast-x, known-y, known-x. Reversing the last two arguments fits a different regression. This is also the order Gnumeric’s official manual and 1.12.62 upstream code specify. There are no optional parameters. [S1, S3]

Copyable worksheet: five months of orders

Enter this table in a blank Gnumeric worksheet; column A holds period and column B holds observed units sold.

Row A — month index (x) B — units sold (y)
1 Month Units sold
2 1 3
3 2 5
4 3 7
5 4 9
6 5 11

Put 6 in D2 as the month to predict, and type into E2:

=FORECAST(D2,B2:B6,A2:A6)

Independently calculated expected result: 13. The points follow y = 1 + 2x exactly; month 6 therefore gives 1 + 2*6 = 13. Verify the fit separately with:

=SLOPE(B2:B6,A2:A6)
=INTERCEPT(B2:B6,A2:A6)

The first formula should give 2, the second 1, based on independent arithmetic. Reconstruct the forecast explicitly:

=INTERCEPT(B2:B6,A2:A6)+SLOPE(B2:B6,A2:A6)*D2

It also gives 13 mathematically. These are documentation-supported predictions, not the results of a native Gnumeric session. See SLOPE and INTERCEPT for related canonical pages. [S1]

Advanced example: imperfect data and extrapolation

Overwrite B2:B6 with 2, 4, 5, 4, 5 (keep A2:A6 as 1, 2, 3, 4, 5). Enter:

=FORECAST(6,B2:B6,A2:A6)

Independent result: 5.8. The fitted slope is 0.6, the intercept is 2.2, and therefore the prediction at x=6 is 2.2 + 0.6*6 = 5.8. The input values, fitted values and residuals do not lie on a perfect line, making this a more realistic explanation than an exact-fit-only example.

Contrast the forecast for an x inside the measured range:

=FORECAST(3,B2:B6,A2:A6)

Independent result: 4. Predicting x=3 is interpolation; x=6 is extrapolation. Extrapolation assumes the straight-line pattern continues beyond the measured range, an assumption the worksheet cannot guarantee. For a report, pair FORECAST with RSQ to inspect fit quality and STEYX for regression standard error, bearing in mind that these diagnostics do not establish causality. [S1]

Reproducing the official documentation example

Gnumeric’s upstream help supplies y observations 11.4, 17.3, 21.3, 25.9, 40.1 and x observations 23.2, 25.8, 29.9, 33.5, 42.7. Put the y-values in A1:A5 and matching x-values in B1:B5; then enter:

=FORECAST(7,A1:A5,B1:B5)

The source documents a result of approximately −10.859397661; an independent least-squares calculation gives −10.8593976609. These agree at the reported precision. The negative result is a consequence of extrapolating far below the measured x range; it is not automatically a physically plausible forecast for every business use case. [S3]

Exact-release source note: The official 1.12.62 source archive was checksum-verified. In src/collect.c, these paired-range functions receive GNM_ERROR_VALUE as the fallback: no accepted pairs, unequal collected lengths and failed numeric callbacks therefore follow a #VALUE! source path. Some manual entries instead name #N/A or #DIV/0 for empty/mismatched/constant inputs. Those manual tokens below are documentation claims, not confirmed runtime outcomes; the actual installed build was not executed.

Pairing, errors, and data-quality checks

Situation What Gnumeric documents / implements Practical response
Empty known-y or known-x dataset, or different numbers of data entries Gnumeric’s manual states #N/A Ensure both ranges contain corresponding observations, with no unexpected omissions. [S1]
All known-x values identical (zero x variance) Gnumeric’s manual states #DIV/0 Supply at least two distinct valid x values; no unique slope exists when x has no variation. [S1]
Text, empty cells, or Boolean values inside the input data Upstream implementation uses flags to ignore strings, blanks and Boolean values while collecting paired values Do not assume that independently filtering the two columns will preserve valid x–y pairs. Confirm paired row alignment, import types and sample size; native mixed-data behavior remains untested in this review. [S3]
Error cells and cell-type coercion Not independently tested in an installed Gnumeric application Trace upstream source values and run native negative-case tests before describing exact propagation.
An extremely distant x Mathematically linear extrapolation still produces a number Flag the extrapolation distance and check whether a linear model is defensible.
#NAME?, arguments misplaced, or formula stored as text Syntax/entry problem Confirm spelling, leading =, comma-separated argument order in the documented English locale, and correct y/x columns. [S5–S6]

Do not replace inconvenient x values with dummy numbers to suppress errors. Avoid statements that FORECAST necessarily predicts time: its x-axis can be any numeric explanatory variable. It is a statistical estimate, not a time-series seasonal forecasting model. [S1, S3]

Advanced pattern: forecast multiple x-values while holding training data fixed

Keep the x and y data in A2:A6 and B2:B6. Enter proposed x-values in D2:D5, e.g. 6, 7, 8, 9. Put in E2:

=FORECAST(D2,$B$2:$B$6,$A$2:$A$6)

Copy E2 through E5. The absolute $ references hold the training data fixed, while the proposed x changes by row. Using the exact-fit first example, the independently expected output sequence is 13, 15, 17, 19. The dollar-sign notation is described in Gnumeric’s official formula manual. [S5]

  • SLOPE — fitted line slope.
  • INTERCEPT — fitted line intercept.
  • RSQ — square of correlation; a simple fit statistic.
  • STEYX — residual standard error.
  • TREND — related regression prediction function; read its own syntax rather than assuming identical arguments.

Gnumeric version, syntax, and compatibility notes

  • Documentation target: Gnumeric 1.12, cross-checked with the 1.12.62 release (released September 20, 2026; GNOME download directory posted September 21). This is documentation/source checking, not an on-device runtime certification. [S1–S4]
  • The function has a dedicated entry in Gnumeric’s Statistics reference and an implementation registered Complete with Basic upstream tests in the public catalogue. Registered means the upstream distribution advertises the function; it does not prove that the individual examples here were run successfully on your OS, distribution, locale or plugin configuration. [S1–S3]
  • Gnumeric’s manual writes English-function examples with an equals sign, uses commas between arguments, and states function names are case-insensitive. Its locale and number formats can vary; these examples use an English-language, dot-decimal configuration. Verify localized input syntax and displayed separators inside your installed application rather than assuming another spreadsheet’s settings. [S5–S6]
  • Gnumeric marks this function Microsoft Excel compatible in its own function help. That is a vendor statement about the documented function, not proof of identical results for all imported files, spreadsheet programs, edge cases or historical editions. ODF/other-spreadsheet behavior has not been used to infer undocumented Gnumeric behavior. [S1]

Official references and evidence status (checked 2026-10-13)

  1. S1 — Official Gnumeric 1.12 Statistics function manual. Relevant lines in current published HTML: 819–848; defines function name, exact argument order, documented errors and vendor Excel-compatibility statement. Publication/update date of the HTML page is not specified; access checked 2026-10-13.
  2. S2 — Official public function catalogue. Statistics listing registers forecast as Implementation: Complete; Testing: Basic. This is upstream catalogue status, not a test performed for this guide; access checked 2026-10-13.
  3. S3 — Official Gnumeric 1.12.62 source archive. plugins/fn-stat/functions.c and src/collect.c were inspected after checksum verification. This is exact-release source evidence, not a native execution.
  4. S4 — Gnumeric release 1.12.62 announcement and GNOME official source-release index. The Gnumeric source ChangeLog records 2026-09-20, and GNOME’s source index timestamps the tarball 2026-09-21. Release availability does not prove that this guide’s examples were run on any installed OS.
  5. S5 — Gnumeric formula entry/type/reference manual, including =, commas, relative/absolute references and typical error names; checked 2026-10-13.
  6. S6 — Gnumeric language/locale manual, locale-controlled numeric representation; checked 2026-10-13.

Validation limits: Exact official 1.12.62 source was checksum-verified and inspected, and all displayed numbers independently recalculated. No native Gnumeric execution, screenshots, locale regression or workbook round-trip tests were performed.