# Pivot Tables

**Key Terms:**

* Value: Data that populates a cell once inside a pivot table
* Rows, columns, and filters remain the same

**How to construct a pivot table**

Pivot tables are operations that can perform some level of aggregation on an existing table of data. Here, it is particularly useful to illustrate the uses of a pivot table with an example, since they vary widely depending on your specific desired application. As a quick reminder, rows refer to horizontal groups of cells and columns refer to vertical groups of cells. Filters are a way to limit which data actually appears on the spreadsheet. As a final note before the example, it is also useful to know the GETPIVOTDATA function, which allows you to retrieve data from a pivot table based on specified labels.

To begin with an example, let’s take a look at this table, which has a couple columns: division, subdivision, product number, units sold, and the price per unit.

![](https://lh4.googleusercontent.com/wJXheORPrSDoXwRTl6eKQLtaZenPQEDAM4TyBfuPjmM-gwza45OUjt0Zrg3opIRKwSpMIE450RFNaAOP-LTMEVw4O7OC1HnjA2eXcNLETT-af40KPkwWJQvZANvVRGV5aDKEFa2F)

While this table is fairly informative on its own, we’d like to put together a report for each division and subdivision to more easily compare their number of units sold. We can accomplish this by using a pivot table. We enter into the Data menu and select Pivot Table while highlighting our current table. Let’s move this pivot table to a new sheet so as not to disturb the original table.

![](https://lh3.googleusercontent.com/dRqtmyZ2uKxEw-XyQHHBW6mMSnr9L42cR2HEFl86gtxTDPTkCihFa2mZs0QkzcrPyI-auDOVMP_PuYseDhcYES7siXcnqmXQ4cnn5Pd9krTLZ48ctzDhylj2wj4XGg2NNhCPbaaV)

As you can see, the pivot table is totally blank. The software needs us to input what we would like to fill the three areas: rows, columns, and values. To start, let’s populate “rows” with divisions, since we’d like to easily compare the east and west divisions of the company.

![](https://lh4.googleusercontent.com/vs9EYPULEVanoXq5-kgZRY7pssKhBMSKaVACHtKUc0_vUPFYt51qw6yQXGAy_0PQOK0UwgbAKujvbUlfGYOf37GRddtI8Fb8DPAxcAj6rE4iSsbOysz3fgbsTVaDvuBMq5udr9-S)

Now let’s add another category for “rows” to break each division into its constituent subdivisions.

![](https://lh4.googleusercontent.com/DCu9QESPSOL0PApKx-41AIXyQk1hj4NgzgIop8hWMDOMEbc-iF46_1xdXFyBj9Z_L5jR2E6El5nSGU3A7aqMPPjhNg2jwXiNdmF-_tjUevawoPt6cFfeYBNYP9w7SfhfPBOeGq9u)

We’ve successfully grouped our data into divisions and subdivisions. Notice how this table is already easier to interpret and compare between east and west division. However, we still need to fill in what we want in the columns and in the cells themselves. Let’s add the product numbers as columns to prepare for filling in the values with the sales numbers.

![](https://lh4.googleusercontent.com/eqZkv83tpZpZo2x4Bd6IA9c4_U-cfGJf4MSBrm3gX4vLIUzQdHoQKx9L-As-SdQWKpJucOP0ZRJVBs41ZRNTTyYecIr4QNhZt6KdfkUD5CH1SRxIzlZXcJa7WjdKuBh0QHe1hxlf)

Almost there! The last step is to fill in the values with the amount sold.

![](https://lh5.googleusercontent.com/poDVseUm2rzWJ0Bg27XmrE9REXLPWaAdmZTcLLogirqgZ-mBGHyhxVf1QmLZxrD8eW3dKimOeSQVWDeIhiC1ThqrfDd2ODXgpZd1FjXti84FyhMSeYxR7EsbVbfsELgG-g8QoGUa)

Done! The pivot table is now complete. We can easily compare the east division’s sales numbers to the west division, and see how each subdivision contributed to the division’s sales. We can even see that product 1 was more popular in both divisions than product 2! What’s more, the pivot table is nicely formatted and should be easy to understand for future users.&#x20;

This is just a simple example of what you can do with pivot tables. A great deal of possibilities arise from simply reordering rows and columns and choosing different values! Additionally, it’s possible to use the Calculated Field feature under values to populate cells with the result of applying a custom formula. It’s up to you to experiment with various sets of data and various customizations that might be more relevant to your specific dataset.
