
Method 2 – Using a Scatter Chart to get the Slope Value There should be more than one set of points, otherwise the SLOPE function returns a #DIV! error.
In case you give it unequal sized ranges, you will get a #N/A error
There should be an equal number of x and y values, when used as input for the SLOPE function. In case there is ‘0’ in any cell/cells, it would be used in the calculation. In case any of the cells are blank or contains a text string, these would be ignored Arguments of the SLOPE function have to be numerical (DATE values are also accepted). Here are a few points to remember when finding the slope of a regression line using the SLOPE function: Y = 138.56*165 + 65803.2īoth slope and intercept values can be positive or negative Points to Remember when Using the SLOPE Function in Excel So now, if I ask you what would be the income of anyone whose height is 165 cm, you can calculate the value easily. With this, our equation for this dataset becomes: Y = 138.56*X + 65803.2 Suppose you have the below dataset as shown below where I have the height (in cm) as X values and average annual income (in USD) as the Y values. If you do it the other way round, you will still get the result but it would be incorrect. Remember that you need to give the Y values as the first argument and X values as the second argument. Here, y_vals and x_vals each consist of an array or range of cells containing numeric dependent data values. The syntax for the slope function is: =SLOPE(y_vals, x_vals) While calculating slope manually could be hard, with the SLOPE function, you just need to give it the x and y values and it does all the heavy lifting in the backend.
It finds the slope value of a given set of x-y coordinates in one step. The easiest way to calculate slope in Excel is to use the in-built SLOPE function.
#CURVE FITTING IN EXCEL FOR MAC HOW TO#
Thankfully, Excel has a formula for that as well, and I will cover how to calculate intercept in all the methods. In this equation, we have already calculated the slope, but to truly know what would be the Y value for a given X value, you also need to know the intercept. Let me explain it with the equation: Y = Slope*X + Intercept So if the height increases by 1 centimeter, the income is likely to increase by USD 138.Īpart from the slope, another thing you need to know about is the Intercept. In our example, if the slope value is 138, which means that there is a positive correlation between height and the income of people. The slope value can be positive or negative.