FORECAST.LINEAR Function (LibreOffice Calc)

Math Beginner LibreOffice Calc LibreOffice 6.2

The FORECAST.LINEAR function in LibreOffice Calc predicts a single Y-value using linear regression. It is the modern replacement for FORECAST. This guide explains syntax, examples, regression logic, errors, and best practices.

The **FORECAST.LINEAR** function predicts a **single Y-value** using linear regression. It is the modern, standards‑aligned replacement for the older FORECAST function and behaves identically.

This guide provides syntax, examples, regression logic, common errors, and best practices, making it one of the most complete FORECAST.LINEAR references available for LibreOffice Calc.

What the FORECAST.LINEAR Function Does

  • Predicts a single Y-value using linear regression
  • Uses the same model as TREND and LINEST
  • Ideal for simple predictions and quick estimates
  • Works with numeric X/Y pairs
  • Works across sheets
  • Fully compatible with Excel’s FORECAST.LINEAR

FORECAST.LINEAR is essentially:

y = m*x + b

Where m and b come from least-squares regression.

Syntax

FORECAST.LINEAR(x; known_y; known_x)

Where:

  • x — the X-value to predict for
  • known_y — dependent variable (Y values)
  • known_x — independent variable (X values)
X and Y ranges must be the same size.

Basic Examples

Predict Y for X = 11

=FORECAST.LINEAR(11; B1:B10; A1:A10)

Predict Y for a value stored in a cell

=FORECAST.LINEAR(D1; B1:B100; A1:A100)

Forecast across sheets

=FORECAST.LINEAR(2025; Sheet1.B1:B50; Sheet2.A1:A50)

Forecast using dates

=FORECAST.LINEAR(DATE(2026;1;1); Sales; Dates)

Advanced Examples

Manual equivalent using SLOPE and INTERCEPT

=SLOPE(B1:B10; A1:A10) * 11 + INTERCEPT(B1:B10; A1:A10)

Forecast ignoring errors

=FORECAST.LINEAR(11; IF(ISNUMBER(B1:B10); B1:B10); A1:A10)

(Confirm with Ctrl+Shift+Enter in older Calc.)

Forecast using filtered (visible) data only

Use SUBTOTAL helper column to filter X/Y before passing to FORECAST.LINEAR.

Forecast with outlier removal

=FORECAST.LINEAR(11; FILTER(B1:B100; B1:B100<1000); FILTER(A1:A100; B1:B100<1000))

Forecast for time-series with irregular spacing

=FORECAST.LINEAR(D2; B$1:B$100; A$1:A$100)

Forecast using named ranges

=FORECAST.LINEAR(NewX; KnownY; KnownX)

How FORECAST.LINEAR Calculates Predictions

FORECAST.LINEAR uses the same regression model as LINEST:

  1. Compute slope (m):

    m = COVAR(known_x; known_y) / VAR(known_x)
    
  2. Compute intercept (b):

    b = AVERAGE(known_y) - m * AVERAGE(known_x)
    
  3. Predict:

    y = m * x + b
    

FORECAST.LINEAR is simply a modern wrapper around these calculations.

Common Errors and Fixes

Err:502 — Invalid argument

Occurs when:

  • X and Y ranges have mismatched lengths
  • Non-numeric text included
  • x is non-numeric

Err:504 — Parameter error

Occurs when:

  • Semicolons are incorrect
  • Range references malformed

FORECAST.LINEAR returns unexpected value

Possible causes:

  • Relationship is not linear
  • Outliers distort regression
  • X-values not aligned with Y-values

FORECAST.LINEAR differs from FORECAST

They are identical — FORECAST.LINEAR is simply the modern name.

Best Practices

  • Use FORECAST.LINEAR for single-value predictions
  • Use TREND for multi-value forecasting
  • Use LINEST when you need full regression statistics
  • Remove outliers before modeling
  • Plot your data to confirm linearity
  • Use named ranges for cleaner formulas
FORECAST.LINEAR is the cleanest, most modern way to generate a single regression-based prediction — simple, accurate, and fully compatible with Excel.