FORECAST function

FORECAST(x, yValues, xValues) FORECAST(x; yValues; xValues)

x — Number or { Number }

The horizontal coordinate of the point.

yValues — { Number }

The vertical coordinates of the data points. This array must have the same size as the xValues parameter.

xValues — { Number }

The horizonal coordinates of the data points. This array must have the same size as the yValues parameter.

Returns — Number or { Number }

The vertical coordinate of the point on a straight line which has been fitted to data using linear regression.

Fits a straight line to data using linear regression and returns the vertical coordinate of a point on that line.

Example

FORECAST(170, { 8, 9, 10, 11 }, { 50, 80, 110, 140 })FORECAST(170; { 8; 9; 10; 11 }; { 50; 80; 110; 140 })

Returns 12.