How to Use TREND Function in Excel (3 Examples)

The TREND function is a Statistical function in Excel. In this article, we will show you how to use Excel’s TREND function with 3 examples.


Download Workbook

You can download the free practice Excel workbook from here.


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.


3 Examples of Using TREND Function in Excel

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 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.

Calculating GPA from Exam Score with the TREND Function in Excel

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.

Predicting Future Value with The TREND Function in Excel

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


Similar Readings


3. Utilizing Excel’s TREND Function for Multiple Sets of X-Values

Until now, we are learning 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.

Utilizing Excel’s TREND Function for Multiple Sets of X-Values in Excel

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.

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.


Related Articles

Sanjida Ahmed

Sanjida Ahmed

Hello World! This is Sanjida, an Engineer who is passionate about researching real-world problems and inventing solutions that haven’t been discovered yet. Here, I try to deliver the results with explanations of Excel-related problems, where most of my interpretations will be provided to you in the form of Visual Basic for Applications (VBA) programming language. Being a programmer and a constant solution seeker, made me interested in assisting the world with top-notch innovations and evaluations of data analysis.

We will be happy to hear your thoughts

Leave a reply

ExcelDemy
Logo