Given partial data about a linear trend, fits an ideal linear trend using the least squares method and/or predicts further values. Learn more
It is a forecasting function and is often used to predict future values based on historical trends.
The function requires at least one array of known y-values (knowndatay) and can also accept an optional array of known x-values (knowndatax). If the known x-values are not provided, the function assumes that the x-values range from 1 to the number of y-values.
Additionally, the function can accept an optional array of new x-values (newdatax), which can be used to predict the corresponding y-values for new or future x-values.
The optional parameter [b] can be set to either TRUE or FALSE to specify whether or not the y-intercept of the regression line should be set to zero. By default, this parameter is set to FALSE.
The syntax for the TREND function is: TREND(knowndatay, [knowndatax], [newdatax], [b]).
For example, if you have an array of known y-values in A1:A5 and an array of known x-values in B1:B5, the formula =TREND(A1:A5, B1:B5) would return an array of y-values that correspond to the best-fit line through those data points. If you also provide an array of new x-values in C1:C3, the formula =TREND(A1:A5, B1:B5, C1:C3) would predict the corresponding y-values for those new x-values.