Fits a straight line to data using linear regression and returns points on that line.
TREND(yvalues, xvalues, new_xvalues, type)
yvalues and xvalues are single row or column ranges specifying points in a set of data.
TREND fits a straight line through these data points, using the linear regression method.
If type is 0 the straight line found will pass through the origin; if type is non-zero or omitted the best fit straight line will be found.
TREND returns an array of the y values of the straight line found, corresponding to the x values in new_xvalues (or if omitted xvalues).
yvalues and xvalues must be the same size. new_xvalues may have a different size.
TREND(B2:B5, A2:A5, A2:A7)
when entered as an array formula in cell C2, where the x values in A2:A7 are 1,2,3,4,5, 6 and the y values in B2:B4 are 2, 4, 6.1, 8 returns {2.01|4.02|6.03|8.04|10.05|12.06}. The data points are very nearly on the line y = 2x (and would be if B4 contained 6 instead of 6.1). The best fit line found is therefore very nearly y=2x.
This example shows how TREND may be used to predict future values.

Predicting Home Prices in a New Suburb
Imagine a real estate analyst is tasked with predicting the future median home prices in a newly developed suburb. The suburb, named "Sunrise Estates," has been undergoing rapid growth, and the analyst wants to estimate what the median price will be in a few years to help potential investors and home buyers.
The analyst has collected the following historical data for the past five years:
Year (x) | Median Home Price in Sunrise Estates (y) | ||
|---|---|---|---|
A | B | ||
1 | 1 | $450,000.00 | |
2 | 2 | $475,000.00 | |
3 | 3 | $510,000.00 | |
4 | 4 | $550,000.00 | |
5 | 5 | $580,000.00 |
The analyst wants to predict the median home price for years 6 and 7. They use a statistical method to project the existing trend. This method, often referred to as linear regression, finds the best-fit straight line through the existing data points. The slope of this line represents the average rate of price increase per year, and the intercept is the starting point.
The analyst uses a function that calculates this linear trend based on the known 'y' values (the median home prices) and the known 'x' values (the years). The function then applies this established trend to new, future 'x' values (years 6 and 7) to predict the corresponding 'y' values (the future median prices).
In this example, the TREND function would take the known price data ($450,000, $475,000, $510,000, $550,000, $580,000) and the known years (1, 2, 3, 4, 5) as its inputs. The analyst would then use the function to find the predicted prices for the new years 6 and 7. The output would be the estimated median home price for each of those years, following the established linear trend.
How TREND is used in the example:
The TREND calculation, which is based on linear regression, is as follows:
The results of the calculation are:
TREND function used for calculation: TREND({450000, 475000, 510000, 550000, 580000}, {1, 2, 3, 4, 5}, {6, 7})
Result for TREND({450000, 475000, 510000, 550000, 580000}, {1, 2, 3, 4, 5}, {6, 7}):
PRODUCT & FEATURES
RESOURCES
Terms | Privacy | Spam Policy
© 2026 Zapof