Lesson 85 of 92 · Free Excel Course
Excel · Excel function reference
Excel TREND Function: Syntax, Examples and Common Errors
How the Excel TREND function fits a straight line to your data and forecasts future values, with TREND vs FORECAST.LINEAR and a free practice workbook.
The Excel TREND function draws the best straight line through numbers you already have and reads values off that line. Point it at past results (sales, costs, sign-ups) and the periods they belong to, and it returns the "smoothed" value for each period, or, if you give it new periods, a forecast for each one. It uses the same least-squares line as LINEST, but instead of handing you the slope and intercept it does the y = mx + b arithmetic for you. TREND works in Excel for Microsoft 365 (Windows and Mac), Excel for the web, Excel 2024, 2021, 2019 and 2016.
Syntax
=TREND(known_y's, [known_x's], [new_x's], [const])
- known_y's (required): the values you already know, such as monthly costs.
- known_x's (optional): the matching x-values, such as month numbers 1 to 12. If you leave it out, Excel uses 1, 2, 3 and so on, one per y-value. With one x column it must be the same size as known_y's. You can give several x columns side by side; then known_y's must be a single column or row.
- new_x's (optional): the x-values you want answers for, such as months 13 to 17. It needs the same number of columns as known_x's. If you leave it out, TREND uses known_x's, so you get the fitted value for every existing point.
- const (optional): TRUE or left out calculates the intercept normally. FALSE forces the line through zero (y = mx).
TREND returns one answer for every new x, so it usually fills several cells. In Microsoft 365, Excel 2021, Excel 2024 and Excel for the web, type it in the top cell and press Enter; the results spill down. In Excel 2019 and 2016, select the whole output range, type the formula and press Ctrl+Shift+Enter.
Examples
Example 1 (Microsoft's own): forecast five more months. Microsoft's TREND example lists revenue for months 1 to 12 and projects months 13 to 17. Its sheet uses columns D and E (=TREND(E2:E13,D2:D13,D16:D20)); here the month numbers are in column A, the revenue in column B, and the next five month numbers in A14:A18.
| A | B | |
|---|---|---|
| 1 | Month | Revenue |
| 2 | 1 | $133,890 |
| 3 | 2 | $135,000 |
| 4 | 3 | $135,790 |
| 5 | 4 | $137,300 |
| 6 | 5 | $138,130 |
| 7 | 6 | $139,100 |
| 8 | 7 | $139,900 |
| 9 | 8 | $141,120 |
| 10 | 9 | $141,890 |
| 11 | 10 | $143,230 |
| 12 | 11 | $144,000 |
| 13 | 12 | $145,290 |
| 14 | 13 | $146,172 |
| 15 | 14 | $147,190 |
| 16 | 15 | $148,208 |
| 17 | 16 | $149,226 |
| 18 | 17 | $150,244 |
The line rises by about $1,018 a month, so month 17 comes out at $150,244, the same five projections Microsoft's example shows ($146,172 to $150,244). Because these months are simply 1, 2, 3 and so on, =TREND(B2:B13,,A14:A18) with known_x's left out returns the same five numbers.
Example 2: fitted values for the months you have. Leave new_x's out and TREND returns the point on the line for each existing month. This uses the six months of sales from Microsoft's LINEST page.
| A | B | C | |
|---|---|---|---|
| 1 | Month | Sales | Trend |
| 2 | 1 | $3,100 | $3,000 |
| 3 | 2 | $4,500 | $4,000 |
| 4 | 3 | $4,400 | $5,000 |
| 5 | 4 | $5,400 | $6,000 |
| 6 | 5 | $7,500 | $7,000 |
| 7 | 6 | $8,100 | $8,000 |
Comparing the two columns shows which months beat or missed the underlying trend. Put both on a line chart (select A1:C7, then Insert > Line) and the trend becomes a straight line through the real figures:
| Month | Sales | Trend |
|---|---|---|
| 1 | $3,100 | $3,000 |
| 2 | $4,500 | $4,000 |
| 3 | $4,400 | $5,000 |
| 4 | $5,400 | $6,000 |
| 5 | $7,500 | $7,000 |
| 6 | $8,100 | $8,000 |
Example 3: forecast the next quarter. Type 7, 8 and 9 in A8:A10 and give them to TREND as new_x's.
| A | B | C | |
|---|---|---|---|
| 1 | Month | Sales | Forecast |
| 2 | 1 | $3,100 | |
| 3 | 2 | $4,500 | |
| 4 | 3 | $4,400 | |
| 5 | 4 | $5,400 | |
| 6 | 5 | $7,500 | |
| 7 | 6 | $8,100 | |
| 8 | 7 | $9,000 | |
| 9 | 8 | $10,000 | |
| 10 | 9 | $11,000 |
Example 4: TREND vs FORECAST.LINEAR. For a single month, =FORECAST.LINEAR(9,B2:B7,A2:A7) also returns $11,000. The two use the same line; the differences are the argument order (FORECAST.LINEAR puts x first), that FORECAST.LINEAR returns one value at a time, and that TREND accepts several x columns. Use FORECAST.LINEAR when you want one cell you can copy down, and TREND when you want a whole block in one formula. The what-if analysis lesson covers FORECAST.LINEAR and Forecast Sheet in more depth.
If your numbers grow by a percentage rather than a fixed amount (they curve upward), a straight line will under-forecast. GROWTH has the same arguments as TREND but fits an exponential curve instead.
Common errors
- Only one value appears. In Excel 2019 or 2016 you entered it in one cell. Select the whole output range and press Ctrl+Shift+Enter.
- #SPILL! The cells the results need aren't empty. Clear them, or move the formula.
- #VALUE! A range includes text or blank cells, usually the header row. Select only the numbers.
- #REF! known_y's and known_x's are different sizes, or new_x's has a different number of columns from known_x's.
- Results drift when copied down. Without $ signs, the ranges move as you copy. Use
$B$2:$B$13or, better, one spilling formula. - Forecasts that look wrong. Mixing up known_y's and known_x's (the values you want to predict come first) gives a completely different line. Also remember a straight line can't see seasons; Microsoft's LINEST page warns that predictions may be invalid outside the range of your data.
Related functions
- LINEST returns the slope and intercept of the same line, plus fit statistics.
- CORREL tells you how closely two columns move together before you trust a trend.
- Statistics in Excel covers correlation, SLOPE and the Analysis ToolPak.
- Goal Seek, Solver and what-if analysis covers FORECAST.LINEAR and Forecast Sheet.
Try it yourself
Download the practice workbook. It has eight months of newsletter subscribers: fill in the trend for every month with one TREND formula, forecast months 9 to 11, check month 9 with FORECAST.LINEAR, and see how far the last month sits from the line. The Answers sheet has the working formulas.
Frequently asked questions
What is the difference between TREND and FORECAST.LINEAR?
Both fit the same least-squares straight line, so for one x column they give identical answers. FORECAST.LINEAR returns one value for one x and puts x first: =FORECAST.LINEAR(9,B2:B7,A2:A7). TREND puts the new x-values third, can return a whole column of answers at once, and can use several x columns.
How do I forecast the next few months with TREND?
Type the next month numbers below your data (for example 7, 8, 9 in A8:A10) and use =TREND(B2:B7,A2:A7,A8:A10). In Microsoft 365, Excel 2021 and Excel 2024 the three forecasts spill down; in Excel 2019 or 2016, select three cells first and press Ctrl+Shift+Enter.
Why does TREND return only one value?
In Excel 2019 and 2016 an array formula entered in one cell shows only its first result. Select the whole output range, type the formula and press Ctrl+Shift+Enter. In newer Excel, a #SPILL! error means the cells below aren't empty.
When should I use GROWTH instead of TREND?
Use GROWTH when your numbers grow by a steady percentage (they curve upward) rather than by a steady amount. GROWTH fits an exponential curve and has the same arguments as TREND; it returns #NUM! if any known y-value is 0 or negative.