FORECAST.LINEAR

See FORECAST

Video field
Statistical

The FORECAST function in Google Sheets is used to predict a future value based on linear regression analysis of existing data.

It calculates the best-fit straight line (linear trend line) through a set of known x and y values and then uses that line to predict the y-value for a given x-value.

The syntax for the FORECAST function is as follows:

FORECAST(x, datay, datax)

x: The x-value or the point at which you want to predict the y-value.

data_y: The known y-values or the dependent variable.

data_x: The known x-values or the independent variable.

The FORECAST function will return the predicted y-value corresponding to the provided x-value, based on the linear trend line calculated from the known data points.

Using the same example as before, suppose you have a set of data with x-values in column A and corresponding y-values in column B. You want to predict the y-value for an x-value of 10.

A\tB 1\t10 2\t15 3\t20 4\t25 5\t30

You can use the following formula in a cell to predict the y-value for x=10 using the FORECAST function:

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

This will calculate the linear trend line based on the known data points and predict the y-value corresponding to x=10.

Want even more from Google Sheets?


With Softr, you can turn your spreadsheets into powerful web apps.You can give advanced roles and permissions to each user, build advanced logic and automation flows, customize the design to your needs, and much more.


Softr also offers a growing library of templates for internal tools, client portals, community hubs, and more. The templates come with a Google Sheet or an Airtable base that you can use to store and manage your data easily.


Try Softr now and build your custom web apps in 10 minutes no code required!