Add Line of Best Fit (& Equation) – Excel & Google Sheets

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on October 30, 2023

This tutorial will demonstrate how to create a line of best fit and the equation in Excel and Google Sheets.

Add Line of Best Fit (& Equation) in Excel

Adding a Scatterplot

  1. Highlight the data that you would like to create a scatterplot with
  2. Click Insert
  3. Click Scatterplot
  4. Select Scatter

Create Chart from Dataset for Best Fit Line in Excel

 

After creating your Scatterplot Graph, it should look something like below

Scatterplot Graph in Excel

 

Adding your Trendline

  1. Click on the Graph
  2. Select Chart Design
  3. Click Add Chart Element
  4. Click Trendline
  5. Select More Trendline Options

Create Trendline for Best Fit Line in Excel

6. Select Polynomial

7. Check Display Equation on Chart

Polynomial Trendline in Excel

Final Graph with Trendline and Equation

After selecting those, a trendline of the series as well as the equation will appear on the graph as shown below.

Trendline Equation for Scatterplot Excel

 

Add Line of Best Fit (& Equation) in Google Sheets

Create a Graph

  1. Highlight the dataset
  2. Select Insert
  3. Click Chart

Add Chart for Best Fit Line in Google Sheets

 

Change to Scatterplot

  1. Click on the Graph
  2. Select Setup
  3. Click Chart Type Box
  4. Select Scatter Chart

Switch Graph Google Sheets Scatterplot

 

Add Trendline

  1. Click on the Scatterplot Graph
  2. Select Customize
  3. Click Series

Trendline Best Fit Google Sheets

 

4. Check Trendline box

Add Trendline to Scatterplot Google Sheets

Add Equation

  1. Under Type, Select Polynomial
  2. Under Label, Select Use Equation

 

Polynomial Trendline Equation Google Sheets

 

 

Final Graph with Trendline and Equation

As you can see, we now have a trendline and a polynomial equation of the best fitting line for the series.

Scatterplot Google Sheet Trendline Equation

AI Formula Generator

Try for Free