Excel 2024: Create Your First Pivot Table


May 02, 2024 - by

Excel 2024: Create Your First Pivot Table

Pivot tables let you summarize tabular data to a one-page summary in a few clicks. Start with a data set that has headings in row 1. It should have no blank rows, blank columns, blank headings or merged cells.

Select a single cell in your data and choose Insert, Pivot Table.

Excel will detect the edges of your data and offer to create the pivot table on a new worksheet. Click OK to accept the defaults.

The Create Pivot Table dialog identified the data as A1:K564 and offers to put the pivot table on a new worksheet.
The Create Pivot Table dialog identified the data as A1:K564 and offers to put the pivot table on a new worksheet.

Excel inserts a new blank worksheet to the left of the current worksheet. On the right side of the screen is the Pivot Table Fields pane. At the top, a list of your fields with checkboxes.

The top half of the Pivot Table Fields pane lists all of the fields from the original data set with a checkbox to the left of each one.
The top half of the Pivot Table Fields pane lists all of the fields from the original data set with a checkbox to the left of each one.

At the bottom are four drop zones with horrible names and confusing icons. Any fields that you drag to the Columns area will appear as headings across the top of your report. Any fields that you drag to the Rows area appear as headings along the left side of your report. Drag numeric fields to the Values area.



You can build some reports without dragging the fields. If you checkmark a text field, it will automatically appear in the Rows area. Checkmark a numeric field and it will appear in the Values area. By choosing Region and Revenue, you will create this pivot table:

A pivot table with regions down column A and Sum of Revenue in column B. A Grand Total row appears below the data.
A pivot table with regions down column A and Sum of Revenue in column B. A Grand Total row appears below the data.

To get products across the top of the report, drag the Product field and drop it in the Columns area:

A pivot table with Products across the top and Region down the side.
A pivot table with Products across the top and Region down the side.

Note

your first pivot table might have the words "Column Labels" and "Row Labels" instead of headings like Product and Region. If so, choose Design, Report Layout, Show in Tabular Form. Later, in "#39 Specify Defaults for All Future Pivot Tables" on page 92, you will learn how to make Tabular Form the default for your pivot tables.

Bonus Tip: Rearrange fields in a pivot table

The power of pivot tables is the ability to rearrange the fields. If your manager decides you should put Regions across the top and products down the side, it is two drags to create the new report. Drag product to Rows. Drag Region to Columns.

The bottom of the pivot table fields pane shows tiles with Product in Columns and Region in Rows. Drag the Product tile to Rows and the Region tile to Columns.
The bottom of the pivot table fields pane shows tiles with Product in Columns and Region in Rows. Drag the Product tile to Rows and the Region tile to Columns.

You will have this report:

The result is a pivot table with Products in column A and Regions across the top.
The result is a pivot table with Products in column A and Regions across the top.

To remove a field from the pivot table, drag the field tile outside of the Fields pane, or simply uncheck the field in the top of the Fields pane.

Bonus Tip: Format a Pivot Table

The Design tab has a gallery with 84 built-in formats for pivot tables. Choose a design from the gallery and the colors change.

There are two tabs in the Ribbon for PivotTable Tools. The second tab is called Design and offers a gallery with different color schemes.
There are two tabs in the Ribbon for PivotTable Tools. The second tab is called Design and offers a gallery with different color schemes.

One frustrating feature with a pivot table is that the numbers always start out as General format. Right-click any number and choose Number Format…. Any changes you make to the number formatting using this command will be remembered as long as Revenue stays in the pivot table. (Before Excel 2010, pivot tables would frequently forget the number formatting. This was fixed in Excel 2010.)

Right-click any numeric cell in the pivot table and choose Number Format.
Right-click any numeric cell in the pivot table and choose Number Format.

Bonus Tip: Format One Cell in a Pivot Table

This is new in Microsoft 365 starting in 2018. You can right-click any cell in a pivot table and choose Format Cell. Any formatting that you apply is tied to that data in the pivot table. In the figure below, Florida Figs have a yellow fill color.

One cell in this pivot table is formatted in yellow. The Florida Fig cell is in C10.
One cell in this pivot table is formatted in yellow. The Florida Fig cell is in C10.

If you change the pivot table, the yellow formatting follows the Florida Fig.

Although Florida Figs are now in C29, they are still highlighted in yellow.
Although Florida Figs are now in C29, they are still highlighted in yellow.

If you add a new inner field, then multiple cells for Florida Fig will have the fill color.

With a new inner row field of sales rep, two cells are highlighted in yellow. Each is sales of Florida Figs, but for different sales reps. The two numbers add up to the originl 9683.
With a new inner row field of sales rep, two cells are highlighted in yellow. Each is sales of Florida Figs, but for different sales reps. The two numbers add up to the originl 9683.

The formatting will persist if you remove Florida or Fig due to a filter. If you filter to vegetables, Fig is hidden. Filter to fruit and Fig will still be formatted. However, if you completely remove either Product or Region from the pivot table, the formatting will be lost.

Bonus Tip: Fill in the Blanks in the Annoying Outline View

If your pivot table is in Tabular or Outline Form and you have more than one row field, the pivot table defaults to leaving a lot of blank cells in the outer row fields:

The outer row field is Region. Midwest appears once in column A followed by rows for Chicago, Cincinnati, Cleveland. Midwest does not appear next to Cincinnati or Cleveland.
The outer row field is Region. Midwest appears once in column A followed by rows for Chicago, Cincinnati, Cleveland. Midwest does not appear next to Cincinnati or Cleveland.

Starting in Excel 2010, use Design, Report Layout, Repeat all Item Labels to fill in the blanks in column A:

After applying Repeat All Item Labels, all of the cells in the Region column are filled in.
After applying Repeat All Item Labels, all of the cells in the Region column are filled in.

Bonus Tip: Replace Blank Values Cells With Zero

There is another way to have blanks in the Values area of a pivot table. Say that you have a product which is only sold in a few regions. If there are no Doodad sales in Atlanta, Excel will leave that cell empty instead of putting a zero there. Right-click the pivot table and choose Pivot Table Options. On the Layout & Format tab, find the box For Empty Cells, Show: and type a zero.

Or, as Hunstville Excel Consultant Andrew Spain discovered, you can simply clear the checkbox to the left of For Empty Cells, Show:

In the PivotTable Options dialog, choose the Layout & Format tab. There is a setting called For Empty Cells, Show:. Type a zero in that box.

Bonus Tip: Rearrange Fields Pane

Howie Dickerman was the Project Manager in charge of pivot tables at Microsoft. He inherited the product and suggests some of the defaults could have been different. For one, he suggests using the gear at the top right of the PivotTable Fields pane and changing the view to Fields Section and Areas Section side-by-side.


This article is an excerpt from MrExcel 2024 Igniting Excel

Title photo by Anne Preble on Unsplash