How to Create a Pivot Table in Excel Online
Spreadsheets are great for cataloging large pools of data, but it takes a feature like pivot tables to really draw conclusions from the data. Excel Online makes it easy to create pivot tables that will help you summarize your data and give you more insight into what your raw numbers mean.
Here, we'll walk you through how to create a pivot table in Excel Online. You can use our demo sheet to practice: Open the sheet in Excel Online, and click Save to OneDrive to start working on your own copy. The examples in this tutorial come from that demo sheet, and you can use it to experiment further once you're ready.
What Is a Pivot Table?
When spreadsheets start expanding beyond a few rows and columns, it becomes difficult to keep track of the data. And when you lose track of the data, you lose track of the meaning behind it. That's where a pivot table comes in—it filters and summarizes your data based on criteria of your choosing.
Let's say you diligently log all your expenses across the whole year in a single spreadsheet. At the end of the year, when you sit down to review, you're going to have a tough time sorting through hundreds of entries. This is what is called a flat data—all you're seeing is a sea of rows and columns. To gain more insight and meaning from the data, you need to see it dynamically. For example, you might want to see how much money you spent on rent and utilities in the last quarter. Using a pivot table, you can do just that.
And that's just a simple example. A pivot table can be used to analyze an unlimited variety of data. That means that you won't have to create a new spreadsheet for each analysis—you can use the same data and manipulate it in the pivot table to get new insights each time.
How to Create a Pivot Table in Excel Online
Here's a quick overview of how to use pivot tables (we'll dive deeper in the next section).
Step 1: Open the Excel Online sheet and select all cells containing the data you want to look at.
Step 2: Select Insert > PivotTable.
Step 3: From the pop-up, select New Worksheet and click OK.
Step 4: In the pivot table editor, drag the rows and columns that you want to summarize to the appropriate box.
Step 5: In the Values section, select the fields that have the values you want to add or calculate.
Step 6: If you only want to display values that meet certain criteria, use the Filters section.
The best way to learn complex tools is by using them. So load up the demo sheet, and follow along below.
Create the Pivot Table
The first thing we need to do is to turn the raw, flat data into a pivot table. Before starting, make sure that all the columns at the top of your sheet are properly named.
Then, select all cells that contain data, and from the toolbar, select Insert > PivotTable.
A pivot table creation box will pop up. It will list the range of the table (the one that you've already determined by selecting the data) and give you the option of creating a pivot table in the same worksheet or a new one. To make things simpler, choose the New Worksheet option and click OK.
This will create a new spreadsheet where you'll build your dynamic pivot table reports.
How to Build a Pivot Table Report
A pivot table starts out empty. All you'll see on the right edge of the sheet is the pivot table editor, where you'll find all the options for building your pivot table.
The editor is divided into two horizontal sections.
- The top section lists all the fields—these are all the columns from your table data.
- In the bottom section, you'll find the actual area for manipulating the pivot table. It's divided into four parts: Filters, Columns, Rows, and Values.
The process of building a pivot table in Excel Online uses drag and drop functionality. You add a field to an area simply by dragging it there. Don't want a field in a box anymore? Drag it out, and it disappears. Beyond that, you'll learn how to use these tools as we go along.
To start, here's the analysis we're going to do as an example from the demo sheet:
For each of our clients, across different project types, how much did we bill in 2017?
In this case, we're looking for four things.
- For each client
- across all project types
- total amount billed
- in 2017
This analysis is built from four parts and it will cover all four sections in the pivot table fields: rows, columns, values, and filters.
- The Rows and Columns will help you build the basic two-dimensional data from which you will calculate the third dimension of values. Here, our basic row and column data is Client Name and Project Type, respectively.
- The Value, or the computation we want to get from the cells related to Client Name and Project Type, is total amount billed (the sum of the Amount Billed column).
- The Filter option will help us filter only the data from the year 2017 and will hide everything else.
Now that we know what kind of report we're building, let's start the process by first adding the rows.
We'll start by adding the Client Name field to the Rows section. There are a few ways of doing this (e.g., click the checkmark next to the Client Name title from the sidebar, click the dropdown at the end of the Client Name section and select Add to Row Labels), but the best way to proceed is by using the drag-and-drop feature.
Click and hold on the Client Name field, drag it to the Rows section in the bottom half of the sidebar, and release it.
Instantly, you'll see the first column populate with all the names of your clients (free of duplicates). By default, this will be sorted in ascending order, but you can click on the dropdown next to the Row Labels cell to change the order.
Next, we'll add the Project Type field as a column. Now that you know the drill, just drag the Project Types field to the Columns section in the bottom of the pivot table editor.
Now you have a two-dimensional table, and it's time to add values to that table.
Drag the Amount Billed option to the Values section. Instantly, you'll have usable information and data in the spreadsheet. You'll notice that a Grand Total section is created automatically (both for rows and columns), and you can already see the grand total for a particular project type and a client independently.
We still don't have our complete answer yet. We now need to filter the data to only show values from 2017.
To do this, drag the Year field to the Filters section. You'll see two new cells at the top of the sheet. The cell next to Year currently says All. Click on the dropdown next to the cell, uncheck the button next to 2018, and click OK.
All the entries from the year 2018 will instantly disappear, and you'll have your answer to the original question: For each of our clients, across different project types, how much did we bill in 2017?
Of course, filtering is not limited to just the year. You can filter based on any column from the original data set.
Now that we have all the important information in front of us, we can use the pivot table to answer any kind of question we have about the data. Let's dive a bit deeper to solidify our understanding of pivot tables in Excel Online using two more examples.
Which client did we bill the most in 2017?
As this is a simpler question, we'll need to first simplify our report. We only need the name of our clients as rows and the sum of the amount billed as values.
So start by removing the Project Type field from the Columns section: Drag it out of the section (alternatively, you can click on the field and select Remove Field).
Now click the dropdown next to the Row Labels cell and select Sort By Value. In the pop-up, Sum of Amount Billed will already be selected. You can choose to sort by smallest to largest or vice versa, depending on your needs. Click OK.
The pivot table now shows exactly how much each client was billed in the year 2017, in ascending order: With $1,700, Questindustries was the highest billed client in 2017.
Let's answer one more question: Which project type had the highest hourly rate on average?
We can now shift from total amount analysis to the average hourly rate.
To do this, remove Client Name from the Rows section and replace it with Project Type. In the Values section, remove Amount Billed and drag in the Hourly Rate field instead.
Now, click on the Sum of Hours Spent button and select Value Field Settings. Here, switch from Sum to Average.
Then go to the Row Labels dropdown, select Sort by Value, and switch to the Largest to Smallest option to see the highest hourly rate at the top of the list. You'll instantly see the average hourly rate across all project types in 2017. The highest hourly rate on average is $68 per hour for copyediting.
Now that you understand the basics of pivot tables in Excel, use our demo sheet to try some even more advanced analyses. Once you get familiar with all the parameters, you'll be able to use them to generate any report that you want.