Estimated reading time: 9 minutes
Simply put, a pivot table is a data analysis technique used to summarize large data sets and answer questions you may have about the data. It is available in spreadsheet applications such as Microsoft Excel and Google Sheets. It's a very powerful way to organize your data.
Here's an analogy to better explain what a pivot table does:
Let's imagine we have a jar of candy:
And we want to understand: how many red candies are there?
How many candies are there in each color?
How many candies are there in each shape?
One way to do this is to manually count them one by one. This can take a long time.
The best way to get the answer is to create a pivot table.
PivotTables are a way to reorganize and summarize complex data sets into one table, which allows us to easily find patterns or solutions to any questions we may have about the data set. In a sense, we are grouping several variables in the dataset. This action is also known as data aggregation.
There are several ways to group these candies:
In essence, this is what a pivot table does. Groups data and allows you to perform calculations such as counting and summing data.
PivotTables are used to summarize and reorganize large amounts of data into an easier-to-understand table that allows us to draw important conclusions.
Use cases/examples of pivot tables in real life are:
PivotTables use functions like SUM and AVERAGE to quickly get the answer to these questions.
When faced with enormous amounts of data, it's easy to feel overwhelmed. This is where pivot tables come in. PivotTables are not just a tool; they are an essential resource in any data analyst's arsenal. Let's find out why you should consider using them:
Pivot tables have come a long way since their introduction. While many associate the term “pivot table” with Microsoft Excel, today's landscape also offers other platforms that have integrated and improved this powerful functionality.
Select the data you want to analyze in Pivot.
At the top, click Insert -> PivotTable -> From Table/Range.
There are 4 boxes: filters, columns, rows and values. Here you can rearrange the different variables to get different results.
How you organize them depends on the questions you want to answer.
In the "values" box, after dragging a variable into it, you can select the calculation you want to apply. The most common are SUM and AVERAGE.
Since we want to get the total of all sales here, we will choose SUM.
Once the pivot table is created, you can sort the data from highest to lowest by right-clicking the table -> sort -> sort largest to smallest.
Creating a pivot table in Google Sheets is very similar to Excel.
Start by opening your spreadsheet in Google Sheets and selecting all your data.
You can quickly select all the data by clicking the top left corner of the spreadsheet or by pressing CTRL + A.
Go to Insert -> PivotTable:
You can create the pivot table in a new sheet or in the existing sheet. It's usually easier to insert it into a new sheet, but it depends on personal preference.
There are two ways to customize a PivotTable in Google Sheets:
1. Using insights suggested by artificial intelligence
2. Using your own input
You can do both using on the right side of the pivot table you just created:
Click “Add” to create your custom pivot table. Similar to Excel, you can manually add variables in “rows, columns, values and filters”.
Now that you've set up a pivot table, how do you know which box to put each variable in? Rows, columns, values or filters?
Here's how to use each:
If you're only dealing with one categorical variable, it doesn't matter which one you use. Both will be easy to read.
But when we want to consider 2 things at the same time, for example sales generated in a “province” and by “genre”, then you will have to mix and match and see which works best. Try placing one in the rows and the other in the columns and see if you like the resulting pivot table.
There is no fixed rule for deciding where to insert each variable. Put it in a way where it's easy to read the data.
Ercole Palmeri
An ophthalmoplasty operation using the Apple Vision Pro commercial viewer was performed at the Catania Polyclinic…
Developing fine motor skills through coloring prepares children for more complex skills like writing. To color…
The naval sector is a true global economic power, which has navigated towards a 150 billion market...
Last Monday, the Financial Times announced a deal with OpenAI. FT licenses its world-class journalism…