Slope Function: Provides the slope or gradient of the line of best fit and its structure is Slope(Y values, X Values). The equation required to do this is as follows The first methods listed in this article will provide an Excel equation that will automatically produce the equation of the line of best fit or trendline in excel provided that the X values are placed in column A of the sheet and the Y values are placed in column B. M = the gradient or slope of the line, andĬ = the y-intercept which is the value of why at the point at which the line crosses the y-axis Method 1 – Calculating The Equation In A Cell How to get the trendline equation in an excel graph can sometimes be challenging to get, however, in this article we will cover two methods that will allow you to get the trendline equation or line of best fit for some linear data.Īll lines can be described using the general linear equation listed below