WorksheetFunction.Forecast_Linear 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. Use this function to predict future sales, inventory requirements, or consumer trends.
Syntax
expression.Forecast_Linear (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_Linear returns the #VALUE! error value.
If known_y and known_x parameters are empty or contain a different number of data points, Forecast_Linear returns the #N/A error value.
If the variance of known_x parameters equals zero, Forecast_Linear returns the #DIV/0! error value.
The equation for Forecast_Linear is a+bx, where and
and where x and y are the sample means AVERAGE(all known_x) and AVERAGE(all known_y).
Example
Dim instance As WorksheetFunction
Dim Arg1 As Double
Dim Arg2 As Object
Dim Arg3 As Object
Dim returnValue As Double
returnValue = instance.Forecast_Linear(Arg1, Arg2, Arg3)
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기