

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