Adding a Trendline to Your Data
A line of best fit (also called a trendline) is a straight line drawn through your data points that shows the overall direction they move in. Google Sheets can draw this line for you automatically once you have a chart made from your data. The line helps you see patterns that raw numbers hide — whether sales are climbing, whether a cost is dropping, or whether two things move together.
You need two things before you start: a chart already created from your data, and at least two columns of numbers. If you haven't made a chart yet, create one first by selecting your data, clicking Insert, then Chart. Once your chart appears, you can add the trendline in about three clicks.
Key Takeaways
- A line of best fit shows the direction your data moves in and works only on scatter charts and line charts, not on bar or column charts.
- You add a trendline by right-clicking the data series (the dots or line on your chart) and selecting "Add trendline" from the menu.
- Google Sheets calculates the line automatically, but you can change the type of line (linear, exponential, polynomial) if the default doesn't fit your data well.
- You can display the equation of the line and the R-squared value on your chart to see how closely the trendline matches your actual data.
Right-Click the Data Series to Open the Trendline Menu
Open the chart you want to add a trendline to by double-clicking it. The chart enters edit mode and you'll see a blue border around it. Now right-click directly on one of the data points (a dot on a scatter chart, or a point on the line of a line chart). Do not click on the axis, the title, or the background — click on the actual data.
A menu appears with several options. Look for "Add trendline" near the bottom and click it. A panel opens on the right side of your screen with trendline settings. The default is a linear trendline, which works for most situations where data moves in a steady direction up or down.
Choose the Type of Line That Fits Your Data
Google Sheets offers several trendline types. Linear is the default and draws a straight line — use this when your data climbs or falls at a steady rate. Exponential curves upward or downward and works when growth speeds up or slows down over time (like compound interest or disease spread). Polynomial creates a wavy line that can dip and rise, useful when data has multiple peaks.
To change the type, look at the trendline panel on the right. Click the dropdown that says "Linear" and select a different option. The chart updates when ready so you can see which line fits your points best. If the trendline runs far from most of your data points, try a different type. For most business and household data, linear works fine.
Display the Equation and R-Squared Value
The equation of the line and the R-squared value tell you how well the trendline matches your data. R-squared ranges from 0 to 1 — a value closer to 1 means the line fits tightly, and closer to 0 means the data is scattered. In the trendline panel, check the box next to "Show equation on chart" and the box next to "Show R-squared". Both values appear directly on your chart.
The equation looks like y = mx + b, where m is the slope (how steep the line is) and b is where it crosses the y-axis. If you're tracking monthly expenses and the equation shows y = 50x + 200, that means expenses rise by 50 each month, starting from 200. The R-squared tells you whether that pattern is reliable — an R-squared of 0.92 means the pattern holds for 92 percent of your data.
Adjust the Line Color and Thickness
By default, the trendline is a thin black line. To make it stand out, you can change its color and thickness. In the trendline panel, look for "Format trendline" or a similar option. Click it to expand color and line-width settings. Choose a color that contrasts with your data points — if your points are blue, make the trendline red or orange so it's straightforward to see.
Increase the line width (thickness) to 2 or 3 pixels if the trendline is hard to spot on a busy chart. A thicker, brighter trendline makes the pattern obvious to anyone reading your chart, whether on screen or printed.
Remove or Replace a Trendline
If you add a trendline and decide you don't want it, double-click the chart to enter edit mode, right-click the trendline itself (the line, not the data points), and select "Delete trendline". The line disappears and your chart returns to showing only the data.
To replace one trendline with another, you don't have to delete first. straightforward right-click the data series again and add a new trendline. Google Sheets removes the old one and draws the new one. You can test different types this way without cluttering your work.
Common Reasons a Trendline Doesn't Appear
If you right-click but don't see "Add trendline" in the menu, you're likely clicking the wrong thing. Make sure you're right-clicking on a data point itself — a dot or a point on the line — not on the background or an axis. Also, trendlines work only on scatter charts and line charts. If your chart is a bar chart or column chart, you cannot add a trendline; you'll need to convert it to a scatter or line chart first.
To convert your chart type, double-click the chart, then look for a chart-type selector (usually a small icon or dropdown in the chart editor). Choose "Scatter chart" or "Line chart" and try adding the trendline again. Another reason the option might not appear is if you have only one data point or one column of data — a trendline needs at least two points to draw a line between them.
Frequently Asked Questions
Can I add more than one trendline to the same chart?
No, Google Sheets allows only one trendline per chart. If you need to compare trends for two different data series, you can create two separate charts or use a scatter chart with two different colored data series, each with its own trendline by adding them one at a time to different series.
What does R-squared actually mean?
R-squared tells you what percentage of your data's variation the trendline explains. An R-squared of 0.85 means the trendline accounts for 85 percent of the ups and downs in your data; the remaining 15 percent is due to other factors or randomness. Higher R-squared values mean the trendline is more reliable for predictions.
Can I use the trendline equation to predict future values?
Yes, you can plug future x-values into the equation to estimate y-values. If your equation is y = 50x + 200 and x represents months, you can estimate month 13 by calculating y = 50(13) + 200 = 850. However, predictions work best when the R-squared is high and when you're not predicting too far into the future.
Why does my trendline look like it doesn't fit my data?
Your data may not follow a straight line. Try changing the trendline type from linear to exponential or polynomial. If the R-squared is very low (below 0.5), your data may not have a clear pattern, or other factors you haven't measured may be affecting it more than the variable you're tracking.