How to Use TREND Function in Excel (3 Examples)

Get FREE Advanced Excel Exercises with Solutions!

The TREND function is a Statistical function in Excel. This article will show you how to use Excelâ€™s TREND function with 3 examples.

Table of Contents

Introduction to The TREND Function

The TREND function calculates the values of a given set of X and Y and returns additional Y-values by using the least square method based on a new set of X-values along with a linear trend line.

• Syntax

=TREND(known_yâ€™s, [known_xâ€™s], [new_xâ€™s], [const])

• Arguments Description
Argument Required/ Optional Description
known_yâ€™s Required A set of dependent y-values that is already known from the relationship of y = mx + b. Here,
• y = the dependent variable to calculate the result for.
• x = the independent variable used to calculate y.
• m = the slope (gradient) of line
• b = a constant value, indicating where the line intersects the y-axis. Equal to the value of y when x = 0.
known_xâ€™s Optional One or more sets of independent x-values that is already known from the relationship of y = mx + b.
• If only one x variable is used, then known_yâ€™s and known_xâ€™s can be ranges of any shape but their dimensions will be equal.
• When more than one x variable is used, then known_yâ€™s must consist of one column or one row, which means it must be a vector.
• If x variable is omitted, then known_xâ€™s is assumed to be the same size of array {1,2,3,â€¦} of known_yâ€™s.
new_xâ€™s Optional One or more sets of new x-values for which the TREND function calculates the corresponding y-values.
• It must have the same number of columns or rows for each independent variable as known_xâ€™s.
• If omitted, the new_xâ€™s is assumed to be equal to known_xâ€™s.
• If both known_xâ€™s and new_xâ€™s are omitted, then they are assumed to be the same size of array {1,2,3,â€¦} of known_yâ€™s.
const Optional A logical value specifying how the constant value b from the equation of y = mx + b should be calculated.
• If TRUE or omitted, b is calculated normally.
• If FALSE, b is set equal to zero.

• Return Value

Calculated Y-values along with a linear trend line.

Using TREND Function in Excel: 3 Examples

In this section, we will show you how to utilize the TREND function to calculate certain values based on given values in Excel.

1. Calculating GPA from Exam Score with The TREND Function

In this section, we will learn how to estimate GPA for a new dataset based on previously given data. Consider the following example, where we will return the Predicted GPA of the New Score in the right table based on the Exam Score and GPA given in the left table.

Steps:

• Pick a cell to store the result (in our case, it is cell F5).
• In the cell, write the following formula,
`=TREND(\$C\$5:\$C\$13,\$B\$5:\$B\$13,E5)`

Here,

\$C\$5:\$C\$13 = known_yâ€™s, dependent y-values.

\$B\$5:\$B\$13 = known_xâ€™s, independent x-values.

E5 = new_xâ€™s, new x-values to calculate the TREND value for.

• Press Enter.

You will get the estimated GPA for the new score you stored in your dataset based on a given set of arrays.

2. Predicting Future Value with TREND Function

Here, we will predict future sales based on occurred monthly sales value.

Look at the following data. We have sales value from Jan-20 to Sep-20, and with the TREND function, we will predict the sales from Oct-20 to Dec-20.

Steps:

• Pick a cell to store the result (in our case, it is cell F5).
• In the cell, write the following formula,
`=TREND(\$C\$5:\$C\$13,\$B\$5:\$B\$13,\$E\$5:\$E\$7,TRUE)`

Here,

\$C\$5:\$C\$13 = known_yâ€™s, dependent y-values.

\$B\$5:\$B\$13 = known_xâ€™s, independent x-values.

\$E\$5:\$E\$7 = new_xâ€™s, new set of x-values to calculate the TREND value for.

TRUEÂ  = logical valueÂ to calculate normally.

• Press Enter.

You will get the predicted sales value of all the upcoming months that you provided in the formula at once.

3. Utilizing Excelâ€™s TREND Function for Multiple Sets of X-Values

Until now, we have learned how to utilize the TREND function only with one x-value. But this time, we will learn how to calculate TREND if there are multiple x-values.

Look at the following dataset. Here, we have more than one x-values (Buyers and Other Cost in the first table). We also want to calculate the Estimated Sales based on two different x-values (New Buyers and New Cost in the right table).

Steps:

• Pick a cell to store the result (in our case, it is cell I5).
• In the cell, write the following formula,
`=TREND(\$E\$5:\$E\$13,\$C\$5:\$D\$13,\$G\$5:\$H\$7)`

Here,

\$E\$5:\$E\$13 = known_yâ€™s, dependent y-values.

\$C\$5:\$D\$13 = known_xâ€™s, multiple sets of independent x-values.

\$G\$5:\$H\$7 = new_xâ€™s, new set of multiple x-values to calculate the TREND value for.

• Press Enter.

You will get the estimated sales value based on multiple x-values that you provided in the formula at once.

Things to Remember

• The known values â€“ known_xâ€™s, known_yâ€™s â€“ need to be linear data. Otherwise, the predicted values could be inaccurate.
• When the given values of X, Y, and new X are non-numeric, and when the const argument is not a Boolean value (TRUE or FALSE), then the TREND function throws #VALUE! error.
• If the known X and Y values are different lengths, then the TREND function returns #REF error.

Download Workbook

You can download the free practice Excel workbook from here.

Conclusion

This article explained in detail how to use the TREND function in Excel with 3 examples. I hope this article has been very beneficial to you. Feel free to ask if you have any questions regarding the topic.

<< Go Back to Excel Functions | Learn Excel

What is ExcelDemy?

ExcelDemy - Learn Excel & Get Excel Solutions Center provides online Excel training , Excel consultancy services , free Excel tutorials, free support , and free Excel Templates for Excel professionals and businesses. Feel free to contact us with your Excel problems.
Sanjida Ahmed

Sanjida Ahmed, who graduated from Daffodil International University with a degree in Software Engineering, has worked with SOFTEKO since 2021. She has written over 100 articles on Excel & VBA and, since 2022, has worked as the Project Manager of the Excel Extension Development Project in the Software Development Department. Since starting this software development, she has established an outstanding workflow encompassing a full SDLC. She always tries to create a bridge between her skills and interests in... Read Full Bio

We will be happy to hear your thoughts

Advanced Excel Exercises with Solutions PDF