Calculates the expected y-value for a specified x based on a linear regression of a dataset. Learn more
In Google Sheets, the formula FORECAST(A1, A2:A100, B2:B100) is used to predict a future value based on the existing data points in ranges A2:A100 and B2:B100, using the value specified in cell A1 as the x-value.
Here's a breakdown of the parameters used in the formula:
A1: This is the reference to a cell containing the x-value for which you want to forecast a corresponding value.
A2:A100: This is the range of cells containing the independent (x) data points. It represents the known x-values.
B2:B100: This is the range of cells containing the dependent (y) data points. It represents the known y-values.
The FORECAST function will use the known x-values in range A2:A100 and known y-values in range B2:B100 to calculate the best-fit straight line and predict the corresponding y-value for the x-value specified in cell A1.
For example, if cell A1 contains the value 2024, and the ranges A2:A100 and B2:B100 represent years and corresponding sales data, respectively,
the formula will predict the sales value for the year 2024 based on the historical data provided in the ranges A2:A100 and B2:B100.