SheetPointers Logo

Lesson 8 – Graphs (How to easily make, edit, and add a trendline to a crisp graph in Google Sheets)

In this article, we will teach you how to make a graph in Google Sheets. But also how to edit it, and do some basic statistical analysis, such as adding a trendline.

Table of Contents

1.Introduction

2. Enter the points/data

3. Format the graph (labels, legends, titles)

4. Basic Statistical Analysis

5. Mini Project

Introduction

As we have said many times, Google Sheets has many different functions. At this point, you should be able to enter and analyze data points. That is an amazing skill to have, but sometimes you may want to visualize the data for a presentation so that it is easier to understand. This is why today we will teach you the most basic but versatile type of graph in Google Sheets, the line graph. There are many other forms of graphs you can make, but the skills you learn to make a line graph, can be easily applied to other graphs.

Before starting, it may be useful to refresh your knowledge on how tables work, and the coordinate system here.

Enter in the points/data

Below we have a graph, displaying the position of an object, as a function of time. As we can see, the more time goes by, the further the object goes away.

Image of the data we want to make a graph out of

However, what if we wanted to display this data visually, to prove that the object does in fact move further away as time goes on. We would do this, by creating a graph. In this case, specifically a line graph. Now, how would we do this? You can follow these simple steps.

Step 1: Highlight the data points (including the headers) which you want to be included in your graph.
Step one of highlighting the data points
Step 2: Go to insert, and then click chart
Shows where to click chart

What this will do is automatically generate a graph, which Google Sheets thinks would work best. This will also open your “Chart Editor”, from which you can change and edit portions of the graph you do not like.

Step 3: Take a look at your graph, and decide if there are any portions of it you want to be changed.
Shows the graph that is plotted

The graph that was generated for us, actually happens to be a perfect graph. However, for the sake of teaching you how to edit certain portions of it, let us change certain parts. In the next section of this article, we will teach you how to change the style of the graph, the title, as well as how to edit the axis.

Format the Graph

Of course there are many different ways you can edit and format a graph within Google Sheets. However today we will teach you some of the most important ones to know. 

I have set some objectives of what to change with the graph. We will:

  • Change the chart type
  • Change the name of the title
  • Change the axes

How to change the chart type

Step 1: Go to the chart editor, and select “Chart type”
Displays the chart editor and shows how it looks like

This opens the many different possibilities of graphs you can choose from. As you see, you can have bar graphs, line graphs, as well as area graphs.

Step 2: Select the type of graph you want
Shows how the graph looks if we make it an area graph

As you can see, we selected an area graph, which transforms the graph’s data points into exactly that. There are many different types of graphs you can create, so be sure to play around with it.

How to change the name of the title

Step 1: Go to the chart editor, and hit the customize tab
Opens the chart editor again
Step 2: Select the “Chart & axis titles” portion of the editor
Step 3: Select what you want to edit the title of, in this case the Chart title
Shows where to click "Chart and axis titles" in order to edit the title of the graph

Through the Chart and Axis tab, you can edit the titles of multiple things. However, for the sake of this article, we will only edit the chart title.

Step 4: Edit the chart title under the “Title text” portion. We will make the chart title be “Graph Example #1”
Step 5: Make sure to see that your chart title has been edited correctly. In our case, it has!
Shows the final product of the graph with the title changed

How to change the axes

In case the graph you generated does not have the correct axes, we would need to edit them. For the sake of our example, let’s say we wanted to make the Position data be on the x axis, and the Time data be on the y axis.

Step 1: Go to the “Setup” portion of your chart editor
Step 2: Under X-axis, click whatever tab is underneath. We have highlighted it in red.
Shows what to click in order to edit the axis
Step 3: Click the window shaped icon labeled “Select a data range”
Step 4: Highlight the data you want to be on the X axis (including the axis label). In our case, it would be the position data
Highlights the data range we want to be as the x axis
Step 5: Make sure it changed correctly. In our case it did!
Step 6: Repeat, but for the Y Axis/Series Data

Basic Statistical Analysis

Now, for the sake of the rest of the article, I will return the graph to a normal scatterplot. It looks like so:

It is a nice graph, but how about we do some simple statistical analysis. There are many things you can do, but today I will teach you how to add a line of best fit and show its equation. 

Step 1: Double click any one of the blue points. This will open the “Series” customization tab.
Displays the chart editor
Step 2: Scroll down until you see the “Trendline” check box. 
Shows where to click to add a trendline
Step 3: Click the check box
Step 4: Scroll further down until you see the label dropdown list. Click it, and select “Use Equation”
Shows where to click to display the equation of the trendline

What this does is display the equation of the line of best fit. You can use this equation in order to determine a good estimate for a line that would fit the rough data points you put in. This can prove to be very useful, especially if you are using spreadsheets for any scientific or mathematical applications.

Conclusion

Thank you for being part of this lesson, we hope you learned a lot. This was a different kind of lesson than the previous ones, so feel free to watch our commentated video below, as it may explain it better than the article. You can also view Google’s official article on this topic here. Lastly, as always, happy spreadsheeting 🙂

About Us

SheetPointers was created by Andrew Lenart and Nikhil Radosevich 

Recent Posts

Follow Us

Weekly Tutorial

Sign up for our Newsletter

We’ll send you a few emails a month with cools tips and tricks. We will never send spam. Unsubscribe any time!