The SLOPE function returns the slope of the linear regression line through a supplied set of x- and y-values.
|known_y’s||An array known y-values|
|known_x’x||An array of known x-values|
Note: The length of the known_x’s array should be the same length as known_y’s, and the variance of the known_x’s must not be zero.
|1||Known x||Known y|
|9||=SLOPE(B2:B6,A2:A6)||-0.72081||Slope of the linear regression line through the data points in A2:A6 and B2:B6|
Note: The underlying algorithm used in the SLOPE and INTERCEPT functions is different than the underlying algorithm used in the LINEST function. The difference between these algorithms can lead to different results when data is undetermined and collinear. For example, if the data points of the known_y’s argument are 0 and the data points of the known_x’s argument are 1:
- SLOPE and INTERCEPT return a #DIV/0! error. The SLOPE and INTERCEPT algorithm is designed to look for one and only one answer, and in this case there can be more than one answer.
- LINEST returns a value of 0. The LINEST algorithm is designed to return reasonable results for collinear data, and in this case at least one answer can be found.
Common Function Error(s)
|Problem||What went wrong|
|#N/A||Occurs if the supplied known_x’s and known_y’s arrays are of different lengths|
|#DIV/0!||Occurs if either:
Notes The equation for the slope of the regression line is:
where and are the sample means (averages) of known_x’s and known_y’s.
See Wikipedia for more information on linear regression.