TREND function
TREND returns predicted y values along a straight-line fit. It extends a linear trend to new points, such as forecasting next quarter from past sales.
Example
Read it as a sentence: fit a straight line to the G1:G5 values against F1:F5 and show the first predicted value, which gives 2.8.
Syntax
TREND(known_y's, [known_x's], [new_x's], [const])
Arguments in [square brackets] are optional.
-
known_y's(required) - The known dependent values.
-
known_x's(optional) - The known independent values; defaults to 1, 2, 3, ...
-
new_x's(optional) - x values to predict for; defaults to known_x's.
-
const(optional) - TRUE (default) calculates the intercept; FALSE forces it to 0.
Returns: Predicted y values along a straight-line fit.
One TREND formula can fill more than one cell. When the result has several values, they spill into the cells below or to the right of the formula.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=TREND(Data!G1:G5,Data!F1:F5) | 2.8 | Fitted values (spills) |
=TREND(Data!G1:G5,Data!F1:F5,6) | 5.8 | New x scalar |
=TREND(Data!G1:G5,Data!F1:F5,{6;7}) | 5.8 | New x array (spills) |
=TREND(Data!G1:G5) | 2.8 | Y only |
=TREND(Data!G1:G5,Data!F1:F5,6,FALSE) | 7.2 | Const FALSE |
=TREND(Data!G1:G5,Data!J1:J5,6) | 4 | Constant x |
=TREND(Data!G1:G5,Data!K1:K3) | #REF! | Different sizes |
=TREND(Data!G1:G5,Data!F1:F5,"abc") | #VALUE! | Text new x |
The Data sheet these formulas read
A cell that starts with = holds that formula.
Watch out for
- Returns an array; wrap in INDEX for a single value.
- Assumes a straight line; poor for seasonal data.
Where it works
- Excel
- TREND is in every version of Excel from 2007 on.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Statistical functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .