WorksheetFunction.Forecast Method (Excel)
Calculates, or predicts, a future value by using existing values. The predicted value is a y-value for a given x-value. The known values are existing x-values and y-values, and the new value is predicted by using linear regression. You can use this function to predict future sales, inventory requirements, or consumer trends.
Syntax
expression .Forecast(Arg1, Arg2, Arg3)
expression A variable that represents a WorksheetFunction object.
Parameters
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
Arg1 |
Required |
Double |
X - the data point for which you want to predict a value. |
Arg2 |
Required |
Variant |
Known_y's - the dependent array or range of data. |
Arg3 |
Required |
Variant |
Known_x's - the independent array or range of data. |
Return Value
Double
Remarks
If x is nonnumeric, FORECAST returns the #VALUE! error value.
If known_y's and known_x's are empty or contain a different number of data points, FORECAST returns the #N/A error value.
If the variance of known_x's equals zero, then FORECAST returns the #DIV/0! error value.
The equation for FORECAST is a+bx, where: and: and where x and y are the sample means AVERAGE(known_x's) and AVERAGE(known y's).