The line of best fit, also called Trendline in Google Sheets, helps shows the relationship between two variables.
It is used to make predictions and understand trends in your data. For example, if you know that a certain number of people use your product each day, you can use a trendline to predict how many people will use your product in the future.
In Google Sheets, you can add a line of best fit to a scatterplot. This guide will show you how.
Step 1: Create your scatter plot
- Select the data you want to include in the scatter plot.
- From the “Insert” menu, select Chart.
- Your chart will automatically be made. Double-click it, and a Chart editor panel will appear on the right side. In the Chart type dropdown, select Scatter chart.
Step 2: Add the line of best fit
- Double-click your scatter chart. The Chart editor will appear on the right.
- In the Customize tab, select the Series dropdown.
- Next, check the box next to Trendline.
- A trendline (line of best fit) will be made for your scatter plot.
Step 3: Customize the line of best fit
Under the Trendline checkbox, there are various options to customize the trendline.
Change the Type of trendline: By default, the Linear trendline is reflected on the chart. But you can choose among the different types of trendlines in Google Sheets:
- Linear: shows the general direction in which a series of data is moving.
- Exponential: used when data is growing at an exponential rate.
- Polynomial: used when data has ups and downs.
- Logarithmic: used when the data has a sharp fall and rise.
- Power Series: used when data increases or decreases at a specific rate.
- Moving Average: used when data has extreme values.
You can also change the:
- Line color.
- Line opacity.
- Line thickness.
- Label (title of your trendline)
- Whether to display the R-squared value.