# How to use the SLOPE function

**What is the SLOPE function?**

The SLOPE function calculates the slope of the linear regression line through coordinates.

**What is a linear regression line?**

A linear regression line is a straight line fit to data to model the linear relationship between two variables. The line of best fit minimizes the distance from all data points and allows predicting one variable from the other.

**What is the line equation?**

The linear equation has the following form: y = mx + b

y - dependent data points

x - independent data points

m - slope

b - where the line intercepts the y axis

The image above shows the following equation: y = 2x+5

**What is a negative SLOPE value?**

The linear equation has the following form: y = mx + b

If m < 0 which means m is negative and the graph slopes downwards, this is demonstrated in the image above.

If m > 0 then it is positive and the graph slopes upwards.

**Related functions**

Excel Function and Arguments | Description |
---|---|

LINEST(known_y's, [known_x's], [const], [stats]) | Returns statistics for a linear trend line fit |

INTERCEPT(known_y's, known_x's) | Returns y-intercept of linear regression line |

FORECAST.LINEAR(x, known_y's, known_x's) | Predicts y value on linear trend line for given x |

TREND(known_y's, [known_x's], [new_x's], [const]) | Returns predicted y values for linear trend model |

SLOPE(known_y's, known_x's) | Returns slope of linear regression line |

**What is the difference between the INTERCEPT function and the SLOPE function?**

The INTERCEPT function calculates the b coefficient meaning where the linear equation crosses the y-axis whereas the SLOPE function calculates the m coefficient which is a measure of the slope.

y = mx + b

**What if the slope is 0 (zero)?**

The image above demonstrates the linear function y = 0x +5 which is the same as y = 5 This function describes a perfectly horizontal line on an xy chart.

This means that a linear function y = mx + b with a slope coefficient equal to 0 (zero) is horizontal.

### SLOPE function example

Formula in cell B10:

Zero values are included but text, logical values and empty cells are ignored.

### SLOPE function Syntax

SLOPE(*known_y's*, *known_x's*)

### SLOPE function Arguments

known_y's |
Required. An array or cell reference to dependent data points. |

known_x's |
Required. An array or cell reference to independent data points. |

### SLOPE function not working

The SLOPE function returns

- #N/A! error if there are a different number of values in
*known_y'sÂ*and*known_x's**.*

### How is the SLOPE function calculated?

SLOPE function = Î£(x - xÌ„)(y - Â È³)/Î£(x - xÌ„)^{2}

xÌ„ - arithmetic mean of x coordinates

È³ - arithmetic mean of y coordinates

### 'SLOPE' function examples

The following article has a formula that contains the SLOPE function.

Have you ever tried to build a formula to calculate discounts based on price? The VLOOKUP function is much easier […]

### Functions in 'Statistical' category

The SLOPE function function is one of 74 functions in the 'Statistical' category.

## How to comment

How to add a formula to your comment<code>Insert your formula here.</code>

Convert less than and larger than signsUse html character entities instead of less than and larger than signs.

< becomes < and > becomes >

How to add VBA code to your comment[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

How to add a picture to your comment:Upload picture to postimage.org or imgur

Paste image link to your comment.

Contact OscarYou can contact me through this contact form