A data analyst looking at a spreadsheet on a computer screen

What Is a Pivot Table?

Dana Daskalova

If you are an aspiring data analyst, you have probably heard of pivot tables. You might have even used a pivot table already, perhaps without realizing it. Pivot tables are a staple in any kind of analysis, and, if you’re building a career in data, you’ll come across them quite often in your day-to-day work. So what exactly is a pivot table, and what are pivot tables used for?

In this post, we’ll provide a clear and comprehensive introduction to pivot tables, and show you what you can achieve by using them.

We’ve divided our guide into the following sections:

  1. What is a pivot table?
  2. What are pivot tables used for?
  3. Pivot table functionalities
  4. Wrap-up and further reading

What is a pivot table? Let’s find out.

1. What is a pivot table?

A pivot table is a summary tool that wraps up or summarizes information sourced from bigger tables. These bigger tables could be a database, an Excel spreadsheet, or any data that is or could be converted in a table-like form. The data summarized in a pivot table might include sums, averages, or other statistics which the pivot table groups together in a meaningful way.

The name “pivot table” actually offers quite a good clue as to their importance and the role pivot tables play in analysis; the dictionary definition of a pivot is a ‘central point, pin, or shaft on which a mechanism turns or oscillates’. This is a very important concept when it comes to conducting data analysis. A database or a dataset typically contains all the information you have been provided with on a certain subject. The very goal of any analysis is to draw insight from this raw data. However, there isn’t much you can say about a table with thousands of rows just by looking at it with the naked eye and scrolling up and down. Drawing insight very often means that you will have to take out certain pieces of the data and wrangle the way they present their content, for example, through summary statistics. Summary statistics are used by data analysts to summarize a set of observations in order to communicate a large amount of information as simply as possible.

2. What are pivot tables used for?

Now we know what pivot tables are, let’s take a closer look at how they might be used. As already mentioned, pivot tables enable data analysts to summarize large datasets into a concise and meaningful table which can be consumed at a glance.

Let’s take a look at a practical example. Below is a small table that contains information about various criteria used to rank the states in America according to quality of life. The raw data shown here relates to the key cities in the state of Florida and their results in various categories.

A screenshot of a dataset in Excel

You can see here that every row stands for a different city (although the names have been anonymized and replaced with a letter from the alphabet). For each row there is a metric, which offers information for a given criterion (listed in the columns). Now, if you received this dataset and were asked to summarize these characteristics for the entire state of Florida, what would be the easiest way to do so?

You guessed it: with a pivot table. With just a few clicks, you can produce a clear summary like the one in the small table below, which shows an average for all the cities distributed by the metrics in the table.

An example of a pivot table in Excel

Shortcuts like this one are very handy, especially if you need to compare more entities. If you weren’t familiar with pivot tables, you would have to type the Average() formula for every column in the input dataset and then format the resulting table so that it looks like the one above, which would take considerably more time, effort and attention.

In the example above, we only have information about Florida; however, it could be the case that you receive a large database with data about key cities in all states of the USA, with the task to compare summary statistics for all of them for the ranking. Again, using a pivot table can aid you in finalizing this task in a very short time.

So, to summarize, the most important usage of pivot tables find a role in:

  • Creating a summary of a large database/dataset
  • Doing so in a quick and handy manner

3. Pivot table functionalities

The example we gave in the previous section covered just one of the many functions that pivot tables are capable of. In the previous example, we needed to calculate averages. But what other functionalities do pivot tables have?

Firstly, you can calculate other descriptive statistics too. Descriptive statistics are measures that show quantitative characteristics about the data, such as count, sum, min, max, product, variance, and standard deviation. You could also choose how this summary table will look; in the Florida example, we have the summary categories distributed as rows in the table, but they could be in the columns though, too. You can also filter data within the pivot table, so that you end up with a result only based on certain criteria. For example, we could look only at the cities that have a personal income higher than 31,900$ on average. This would change the previous table into this one (below), simply by applying one filter:

Another example of a pivot table in Excel

You can see that, with very little effort, we have changed the perspective of the analysis. This also raises another point: pivot tables are an excellent tool for exploratory analysis. Exploratory analysis refers to discovering some baseline statistics and characteristics about the data, which gives you guidance about the nature of its contents. This could include descriptive statistics as well as missing observations and extreme values in the dataset. Using some grouping techniques and summary measures in a pivot table, you could perform some quick explorations.

Pivot tables also support another handy tool for exploratory analysis. Once you have your data summarized, you can create some plots like bar charts and scatter plots in order to visualize your findings. For example, imagine you had some equivalent data also for the state of California and you would like to compare the means of selected columns for both states. This is what this would look like:

An example of a pivot table in Excel

Instead of looking at the numbers in the table, you can easily create a bar chart where the differences between the two states are much more visible, as seen below.

A bar chart which has been created using the data from a pivot table

To recap, here are the main functionalities of pivot tables:

  • Calculate various descriptive statistics of the underlying data
  • Filter data based on a specific criterion/criteria
  • Create visualisations of the conducted analysis

4. Wrap-up

In this post, we explored the role of pivot tables in basic analysis. We looked at a few examples of why this type of pivoting your data is important and how it could speed up your work. Let us sum up the key takeaways so far:

  • Pivot tables are great for creating summary statistics with any metrics you want, including showing only the data you are interested in by applying filters
  • The result of these tables with summed up metrics could be used for exploratory analysis
  • It is easy to carry on with data investigation through the user-friendly visualizations that can be created in pivot tables

The best part about pivot tables, especially in Excel, is that they act like dynamic reports. The tables you create contain statistics and results you could present to a stakeholder, but additionally, they are not static, which means you can change them all the time without starting from scratch. Creating a pivot table in Excel has its intricacies, but once you get the knack of it, this skill will soon start paying itself off. We’ll show you how to create a pivot table in this step-by-step guide.

For a hands-on introduction to data analytics in general, try out this free five-day short course. And, if you’d like to learn more about key data analytics tools and techniques, check out the following:

What You Should Do Now

  1. Get a hands-on introduction to data analytics with a free, 5-day data analytics short course.
  2. Take a deeper dive into the world of data analytics with our Intro to Data Analytics Course.
  3. Talk to a Career Advisor to discuss career change and find out if data analytics is right for you.
  4. Learn about our graduates, see their portfolio projects, and find out where they’re at now.

If you enjoyed this article then so will your friends, why not share it...

Dana Daskalova

Dana Daskalova

Contributor to the CareerFoundry blog

Dana has been passionate about statistics and analysis for a number of years, having used a multitude of tools like SPSS, SAS, R and Python. During this time her analytical journey has had a very diverse nature, starting out from social sciences through market research and spending a fair amount of time in financial risk assessment. Now she has redirected her efforts into conveying knowledge to others and tutoring beginners in data analysis.