How to Use TREND Function in Excel (3 Examples)

 

Introduction to The TREND Function

The TREND function calculates the values of a given set of X and Y variables 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 the TREND Function in Excel: 3 Examples

Example 1 – Calculating GPA from Exam Scores with The TREND Function

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).
  • Insert the following formula:
=TREND($C$5:$C$13,$B$5:$B$13,E5)
  • Press Enter.
  • AutoFill the column.

Calculating GPA from Exam Score with the TREND Function in Excel


Example 2 – Predicting the Future Value with the TREND Function

We will predict future sales based on monthly sales value. 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).
  • Insert the following formula:
=TREND($C$5:$C$13,$B$5:$B$13,$E$5:$E$7,TRUE)
  • Press Enter.

Predicting Future Value with The TREND Function in Excel


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

We have more than one independent variables (Buyers and Other Cost in the first table). We want to calculate the Estimated Sales based on 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).
  • Insert the following formula:
=TREND($E$5:$E$13,$C$5:$D$13,$G$5:$H$7)

The arrays for the x-values in the formula are both 2-dimensional (C:D and G:H)

  • Press Enter.

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


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), the TREND function throws #VALUE! error.
  • If the known X and Y arrays have different lengths, the TREND function returns the #REF error.

Download the Practice Workbook


<< Go Back to Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Sanjida Ahmed
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

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo