When working with graphs or charts in Excel, you may need to add a line to visualize the general trend in your data. This line is created based on certain equations. In this article, we will learn how to find the equation of a line in Excel.

## What Is Trendline in Excel?

Theoretically, a** trendline** is a linear or curved line in a graph or chart that defines the general pattern of the selected dataset. It is also referred to as the **line of best fit**. The **trendline** is widely used for showing data movements over a certain period of time. It also shows the interrelation between two variables.

The trendline only connects general data points in the chart, not all points ignoring errors and exceptions. It is also used for forecasting.

## Step by Step Process to Find the Equation of a Line in Excel

Now, letâ€™s get into the main part of our article. Following is the step-by-step process for finding the **equation of a line**. So, without any delay, letâ€™s begin the process.

### Step 1: Prepare Dataset

To describe the process, create a dataset with the information of **Item Name**, **Sold Items,** and **Sales** amount for 6 types of fruits.

Here the values in **columns C** and** D** will act as** Y **and** X axis **respectively.

**Read More:** How to Get Y Equation on Excel Graph

### Step 2: Create a Scatter Chart

Now, we will create a chart out of the dataset. Simply follow the process below:

- First, select cell
**range C5:D10**.

- Then, go to the
**Insert**tab and select**Scatter Chart**from the**Charts**group.

- Following, choose
**Scatter**from the options.

- Thatâ€™s it, you will see the chart on your worksheet.

### Step 3: Add Trendline to the Chart

So as we have our chart, let us insert a trendline based on the dataset.

- In the beginning, select the chart.
- Then, click on the
**Plus**(**+**) icon defining**Chart Elements**.

- Now, mark the
**Trendline**option from the**Context Menu**.

- Finally, you will see a trendline has appeared on the chart.

- After some formatting, the trendline looks like this:

**Read More: **How to Add a Trendline to a Stacked Bar Chart in Excel

### Step 4: Find the Equation of the Line

Now comes the stage where we will find the equation of this line. Letâ€™s see how it works.

- First, select the line on your chart.
- Then, right-click on it and choose
**Format Trendline**.

- Following, you will be directed to the
**Format Trendline**panel on the right. - Here, mark checked the
**Display Equation on chart**box.

- Thatâ€™s it, we can visualize the equation beside the line now.

**Read More: **How to Show Equation in Excel Graph

### Step 5: Add Decimal Places to the Equation

For further understanding, let us add decimal places to the values in the equation.

- Firstly, select the trendline again.
- Secondly, right-click on it and select
**Format Trendline Label**from the**Context Menu**.

- Thirdly, select
**Number**from the**Category**list in the**Format Trendline Label**panel.

- Following, insert your required value in the
**Decimal places**box.

- Lastly, you will see decimal points have increased in the line equation.

**Read More: **How to Create Equation from Data Points in Excel

## How to Find Slope of Line Equation in Excel

To get the slope of the equation,** Microsoft Excel** has benefitted from the **SLOPE** function. Letâ€™s try this function and find out the value of the slope.

- First, select cell
**C12**on your worksheet. - In this cell, insert this formula.

`=SLOPE(D5:D10,C5:C10)`

- After this, press
**Enter**. - Thatâ€™s it, you will see the value of the slope for the line in Excel.

Here, we used the **SLOPE** function to calculate the rate of change between dependent and independent variables. According to the dataset, cell** range D5:D10 **defined the dependent data points placed on the **Y axis**. On the other hand, **cell range C5:C10 **acts as the independent data points plotted on the** X-axis**.

**Note**: You can also apply the

**LINEST**function to count the slope. Just make sure to press

**Ctrl**+

**Shift**+

**Enter**after inserting this formula.

`=LINEST(D5:D10,C5:C10)`

**Download Practice Workbook**

Download this sample file and try it yourself.

## Conclusion

Concluding this article with the hope that it was helpful for you on how to find the equation of a line in Excel with quick steps. Let us know your insightful suggestion in the comment box.

## Related Articles

- How to Find the Equation of a Trendline in Excel
- How to Use Trendline Equation in Excel
- How to Find Slope of Trendline in Excel
- How to Find Unknown Value on Excel Graph
- How to Find Slope of Polynomial Trendline in Excel
- How to Find Intersection of Two Trend Lines in Excel

**<< Go Back To Trendline Equation Excel | Trendline in ExcelÂ |Â Excel ChartsÂ |Â Learn Excel**