

Type " =TREND(" or use the Insert Function ( fx) menu in Excel. Open the internal datasheet and add a new series, e.g., "Trendline 1".Ĭalculate the first value of the trendline using the TREND function: If you look at the formula used to calculate the trend line, you will see within it the slope and the intercept.To create a trendline in a line chart, add a new series to the line chart, then calculate its values to form a trendline, e.g., by using the TREND function of Excel: There is another function that we can use to calculate the slope. The result is a value that should be entered as Set Intercept value in the Trendline Format menu in order to get the proper appearance of the trend line.

Its syntax is:įor the given data in the example it is necessary to write the formula: Choosing this option will in most cases reduce the value of R 2, but the appearance of the trend line will more closely match the actual state.Įxcel also has an INTERCEPT function that, for given data, calculates a value on the Y axis where the trend line should pass. If we choose a value of 0, it means that it goes through a coordinate start. This is the value on the Y axis that the trend line should go through. Next one should correct the trend line, and this is done by launching the Format Trendline option and further selecting Set Intercept option in the menu on the right, then specifying a numeric value.

This is especially pronounced if we created a Scatter chart, and we know that for events X and Y, the trend line must go through the coordinate start. How else can you improve the trend line appearance?Įven if we chose a good function and R 2 has a value very close to number 1, in some cases it would seem illogical. By displaying the value of R 2 we can see how well we chose the function that approximates the data. For a given series we can add a trend line which, by applying the selected mathematical function, approximates and shows the trend of data, which was discussed in one of the earlier posts.
