How to Add and Format Trendlines to Graphs in Google Sheets

Adding trendlines to graphs in Google Sheets is an easy way to visualize patterns and trends in your data. Trendlines can be added to bar, line, column, or scatter charts.

Prerequisites

Before adding a trendline, you need to have a chart already inserted in your Google Sheets spreadsheet. If you don’t have a chart yet, here are the steps to insert one:

  1. Click on the “Insert” tab
  2. Click on “Chart”
  3. Select the chart type you want (bar, line, column, scatter)
  4. Select the data range to use for the chart
  5. Customize the chart as needed

Once your chart is created, you can add a trendline.

Adding a Trendline

Here are the steps to add a trendline in Google Sheets:

  1. Double click on the chart to open the chart editor
  2. In the right sidebar, click on the “Customize” tab
  3. In the “Series” section, click on the dropdown menu next to “Apply to” to choose which data series you want the trendline to apply to. You can also select “Apply to all” to add the trendline to all data series.
  4. Check the box next to “Trendline”

The trendline will now show up on your selected data series. By default, a linear trendline will be added.

Formatting the Trendline

Once the trendline is added, you can customize its format by changing the following options:

  • Type: Choose from linear, exponential, polynomial, logarithmic, or moving average.
  • Line color: Select the color for the trendline.
  • Line opacity: Make the line more transparent by lowering the percentage.
  • Line thickness: Make the line thicker or thinner.
  • Label: Display or hide the trendline equation and R^2 value on the chart.
  • Show R^2: For linear trendlines, display the R^2 value to show strength of fit.
  • Polynomial degree: For polynomial trendlines, select the polynomial degree.
  • Period: For moving average lines, set the number of periods to average.

Here is an example format trendline dialog box:

Format trendline dialog box

By customizing these options, you can format the trendline to best display the pattern in your data.

Trendline Types

Google Sheets supports six types of trendlines:

  • Linear: Use when the data closely follows a straight line. The equation is y=mx+b.
  • Exponential: Use when data rises and falls proportional to its current value. The equation is y=Ae^(Bx).
  • Polynomial: Use when data fluctuates. The equation is ax^n + bx^(n-1) + … + zx^0.
  • Logarithmic: Use when data rises and then levels out. The equation is y=a + b ln(x).
  • Moving average: Plots the average of a number of previous periods. Helpful for smoothing out fluctuations.
  • Power: Similar to exponential, but with a steeper curve. The equation is y=Ax^B.

Choose the trendline type that best fits your data patterns.

Example Uses

Here are some examples of using trendlines in Google Sheets:

  • Show overall growth trend in sales data over time
  • Compare actual sales to projected sales trendline
  • Smooth out daily stock price fluctuations using a moving average trendline
  • Show exponential growth in social media followers
  • Forecast future values with a linear trendline and formula

Tips

  • Add a trendline for each data series by customizing per series
  • Display R^2 value and label to show strength of fit
  • Adjust transparency to make chart easier to read
  • Pick the simplest trendline that fits the data pattern
  • Remove trendline if it doesn’t model the data accurately

Using trendlines on your Google Sheets charts is an easy way to visualize the patterns and trends in your data. By customizing the trendline type and format, you can create clear and meaningful charts to better understand your data.