Skip to content

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.

B14=TREND(B2:B13,A2:A13,A14:A18)
AB
1MonthRevenue
21$133,890
32$135,000
43$135,790
54$137,300
65$138,130
76$139,100
87$139,900
98$141,120
109$141,890
1110$143,230
1211$144,000
1312$145,290
1413$146,172
1514$147,190
1615$148,208
1716$149,226
1817$150,244
One formula in B14 spills five forecasts (shown to the nearest dollar). Rows 2-13 are actual revenue.

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.

C2=TREND(B2:B7,A2:A7)
ABC
1MonthSalesTrend
21$3,100$3,000
32$4,500$4,000
43$4,400$5,000
54$5,400$6,000
65$7,500$7,000
76$8,100$8,000
The trend climbs exactly $1,000 a month from $3,000. Month 3 is $600 below the line; month 2 is $500 above it.

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:

Sales vs trend$0$2,000$4,000$6,000$8,000$10K123456Sales ($)MonthSalesTrend
Sales vs trend
MonthSalesTrend
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
Actual sales zigzag; TREND's values sit on the straight best-fit line.

Example 3: forecast the next quarter. Type 7, 8 and 9 in A8:A10 and give them to TREND as new_x's.

C8=TREND(B2:B7,A2:A7,A8:A10)
ABC
1MonthSalesForecast
21$3,100
32$4,500
43$4,400
54$5,400
65$7,500
76$8,100
87$9,000
98$10,000
109$11,000
One formula in C8 spills three forecasts. Month 9 matches the $11,000 that Microsoft's LINEST example predicts.

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$13 or, 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

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.