TREND

Given partial data about a linear trend, fits an ideal linear trend using the least squares method and/or predicts further values. Learn more

Video field
Array

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.

Want even more from Google Sheets?


With Softr, you can turn your spreadsheets into powerful web apps.You can give advanced roles and permissions to each user, build advanced logic and automation flows, customize the design to your needs, and much more.


Softr also offers a growing library of templates for internal tools, client portals, community hubs, and more. The templates come with a Google Sheet or an Airtable base that you can use to store and manage your data easily.


Try Softr now and build your custom web apps in 10 minutes no code required!