How to Create a Basic PivotTable in Microsoft Excel - TurboFuture - Technology
Updated date:

How to Create a Basic PivotTable in Microsoft Excel

Joshua has work experience in manufacturing, distribution, and aerospace. He received his BBA in accounting from Kent State University.

PivotTable

A PivotTable summarizes data from a data set. It's created when the PivotTable function sorts, averages, sums, and groups data. This function is useful when large amounts of data need to be looked at from different perceptions for decision making.

A PivotTable summarizes data from a data set. It's created when the PivotTable function sorts, averages, sums, and groups data. This function is useful when large amounts of data need to be looked at from different perceptions for decision making.

What is a PivotTable?

A PivotTable allows an Excel user to create an dynamic report of data known as a PivotTable report. PivotTables are very effective at taking a vast amount of information and creating a meaningful presentation of that data as an output. Not only can PivotTables show data in multiple views, they can also be programmed with formulas to perform calculations. It's essentially a table that summarizes another table and is very helpful when it comes to making sense out of a large amount of data. A PivotTable consists of columns, rows, values, and filters which are summarized below.

PivotTable Construction

PivotTables take practice but building them is an easy concept. After a PivotTable is inserted, attributes (fields) of the source data are then organized into one or more sections of a PivotTable (columns section, values section, rows section, filters section) to create the table. Each section can be seen in the illustration below.

PivotTable Fields and Sections

After the PivotTable is created, the Excel user is given options to set up the PivotTable. Each field that is reported needs to be categorized as either a row, column, filter, or value to create the PivotTable.

After the PivotTable is created, the Excel user is given options to set up the PivotTable. Each field that is reported needs to be categorized as either a row, column, filter, or value to create the PivotTable.

PivotTable Sections

Column

The column section in a PivotTable represents the heading area that stretches from left to right along the top of the PivotTable. When data is added to the columns area the unique values relating to those columns can be displayed in the rows area. The column can be used to show a trend over time or a data matrix.

values

When source data needs to be calculated, counted, summed, or averaged, the values area can be utilized. When using the values area in a PivotTable the values being used are measured.

Rows

When data is dragged to the rows section the data displays on the left-hand side of the PivotTable. The Rows area may not have any field added to it but will typically have at least one field.

Filters

The filters area is optional for your data. This section allows you to filter the data however you see fit to convey a clear message about the data. The field that is dropped here is data that has focus on it. This data may need to be sorted or narrowed with a filter.

Collecting Data

The sample data shown below can be downloaded here if you would like to follow along with this PivotTable creation tutorial. This data set shows international statistical projects being performed around the globe. Columns display ID Number, Name, Country Code, Country, Region, and several more attributes.

PivotTable Sample Data

The table shown is the illustration above is a list of statistical projects and attributes of those projects.

The table shown is the illustration above is a list of statistical projects and attributes of those projects.

Creating a Simple PivotTable

To create a PivotTable, you need to have some type of source data. Source data should be data that represents records that have more than one column. If following along, open the spreadsheet in Microsoft Excel from the link above. Be sure to save the spreadsheet before working on it.

Select the insert tab and click on the PivotTable icon in the “Tables” group on the left-side of the ribbon. The Create PivotTable dialog box appears and needs data. If your data is already saved as a table selecting any cell within that table will add the whole table to the Table/Range field. Otherwise, select the complete range of your data for this field.

Next, decide if you want the PivotTable to be shown on a new sheet or on the current worksheet. If you want the PivotTable to show on the current worksheet, you’ll have to select which cell you want the table to start in. Since there is so much data in the example, I would like the PivotTable to have its own worksheet. After you decide, click OK.

Adding Source Data

When the "Create PivotTable" window appears, the table may be selected automatically. If not select the whole range of the table to add to the Table/Range field.

When the "Create PivotTable" window appears, the table may be selected automatically. If not select the whole range of the table to add to the Table/Range field.

Know Your Design

At this point, the PivotTable is empty. The next step is to populate the PivotTable using the PivotTable Field Pane. There are two very important questions to ask yourself before creating a PivotTable which are: “What data to I want to display?” and “How to I want to display it?” to determine which fields go where.

Blank PivotTable

This is what the Excel Workbook should look like at this point. The PivotTable above is ready to be designed and will display values once fields are dropped into filters, rows, columns, and values.

This is what the Excel Workbook should look like at this point. The PivotTable above is ready to be designed and will display values once fields are dropped into filters, rows, columns, and values.

My PivotTable Design

For this PivotTable I would like to see the sum of the total loan amount and the project name associated with that value. I would also like to filter out any records that have loan amounts under $10 million dollars and see each value categorized by region in a matrix type format.

First, I will establish a value (loan amount) for the PivotTable. The total loan amount needs to be dragged from the fields list to the value section. This value will appear as a sum. Since each record is unique, there will be no sum. If there were records with the same project name, they would be combined and a sum of the two would be displayed.

Next, the project name needs to be dragged from the fields list to the rows section. You'll notice that the PivotTable side bar disappears after it was edited the first time. To get the side bar to appear again right click on any header in the PivotTable and select "View Field Settings." The illustration below shows what the PivotTable should look like after adding the project name to rows.

The above result shows the project name with the sum loan amount. Note that each record is distinct so there really is no sum of this attribute. If another record were added that matched an existing project name, the loans would sum.

The above result shows the project name with the sum loan amount. Note that each record is distinct so there really is no sum of this attribute. If another record were added that matched an existing project name, the loans would sum.

Next, I would like to filter out any loan amounts under $100 million dollars. To do this I will need to drag the loan amount field to the filters section of the PivotTable. As a result, a filter is added to the PivotTable for that field. When I click on the drop down that is located on the new header "Row Labels," I must choose the option "Value Filters," then click on greater than or equal to. See the operation in the illustration below.

how-to-create-a-basic-pivottable-in-microsoft-excel

The values filter requires a value that will filter out any values below it. Since I need to display $100 million in loans and above, I will added 100 to the field.

how-to-create-a-basic-pivottable-in-microsoft-excel

The PivotTable below shows the data after being filtered.

how-to-create-a-basic-pivottable-in-microsoft-excel

Now that I have only the high value loans of $100 million and more, I'd like to show each value by region. The goal is to create a matrix that will categorize each loan value by region. To do this the regions field value needs to be added to the columns section. The resulting table is shown below.

how-to-create-a-basic-pivottable-in-microsoft-excel

Insert a Graphical Representation of the PivotTable

Sometimes having a graph of the PivotTable will help you compare categorized data and high and low values. We will see both after graphing this PivotTable. To insert a chart, click on Analyze located under the PivotTable Tool section of the ribbon. Now find and click on the insert Pivot Chart button.

how-to-create-a-basic-pivottable-in-microsoft-excel

Choosing the Right Chart

Based on the type of data in the chart Excel will decide what type of chart will be available for your PivotTable. In this case I can only select between bar charts and pie charts. The best visual representation of this data would come in the form of a clustered bar chart.

how-to-create-a-basic-pivottable-in-microsoft-excel

Clustered Bar Chart

With the clustered bar chart each project can be compared. The chart was automatically color coded by region when it was selected.

With the clustered bar chart each project can be compared. The chart was automatically color coded by region when it was selected.

Conclusion

This PivotTable could have been displayed dozens of different ways. Depending on your goals for reporting the data, the table will need to be structured differently. In most cases with a PivotTable, some trial and error will be involved in the design of the table. To get good practice at these tables it’s best to try to come up with as many different table styles as you can to get a feel for the PivotTable function.

To get a better understanding of how PivotTables work in Excel I recommend the following book. I have been using the Excel Bible for years to improve my understanding of all aspects of this Microsoft product.

The Excel 2019 Bible

This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional.

© 2018 Joshua Crowder