|
|
In the PivotTable Field List, the fields usually appear in the same order that they appear in the source data. If the pivot table source data has lots of fields, it might be hard to find a specific field in the list.
To make it easier to find the fields in the long list, you would like the field list in alphabetical order.
Sort the List
You can change a pivot table option, to make the PivotTable Field List show the fields in alphabetical order.
- Right-click a cell in the pivot table, and in the pop-up menu, click PivotTable Options.
- In the PivotTable Options dialog box, click the Display tab.
- At the bottom of the Display tab, in the Field List section, select Sort A to Z, and then click OK
Later, if you want to return the field list to its original order, select Sort in Data Source Order, instead of Sort A to Z.
_______________
This week, John Walkenbach, aka Mr. Spreadsheet, used a pivot table report to analyze his website’s Amazon sales for 2009. Here’s a screenshot of the results, showing the top sellers, and number of units sold.

John knows a thing or two about Excel, having written over 40 Excel books, so take a look at the full list, and see if there’s something there that will help you.
Excel 2007 Power Programming with VBA
I bought a copy of John’s Excel 2007 Power Programming with VBA a couple of years ago, and highly recommend it. The book is a great reference when you’re learning VBA, or upgrading from an earlier version of Excel.
In its 1104 pages, the book covers pretty much everything you need to know about Excel VBA, and comes with a CD that contains:
- Sample files for the book’s VBA tutorials
- A searchable PDF version of the book
And best of all, there’s a chapter on Pivot Table Programming, that will help you get started with the new pivot table features in Excel 2007. In that chapter, you’ll discover what’s new in Excel 2007 pivot tables, and learn how to:
- create pivot tables with VBA
- create a complex pivot table
- create multiple pivot tables
- use VBA to change a summary table to a worksheet table
_____________
Note: I earn a small commission if you purchase products through the Amazon links. Thanks!
_____________
Chandoo, at the Pointy Haired Dilbert blog, has posted 5 Excel Pivot Table tricks today. His blog posts are always informative and entertaining, so go and take a look.
The 5 Pivot Table tricks are:
- Drill Down Pivot Tables
- Change Summary from Total
- Slice and Dice Pivots
- Difference from Last Month
- Calculated Fields in Pivots
Did you know all those pivot table tricks? Learn anything new?
______________
For more information on Pivot Tables, please see the Pivot Table Tutorials on the Contextures Website.
______________
The team at PowerPivot for Microsoft Excel 2010 created the Excelerators Quiz, where you can test your Excel skills. To make the challenge more exciting, they’re sponsoring a giveaway on the Contextures blog (for USA residents only).
The blog giveaway prize has a total value of over $250, and will include a Dell ST2310 23 inch flat panel monitor, keyboard, and mouse.
How to Enter
To enter the giveaway, after you take the Excelerators Quiz, go to the Contextures blog, read the rules, and add a comment. In your comment:
- Create your own unique question for the Excelerators Quiz.
- Make your question multiple choice, with the correct answer as one of the four options.
The Alpha Geek Challenge
The PowerPivot team has also launched an Alpha Geek Challenge for more advanced excel geeks. Donald Farmer will host a PowerPivot competition in which the Grand Prize winner will receive an all-expenses paid trip to the 2010 Microsoft BI Conference in New Orleans, LA in June.
After you finish the Excelerators Quiz, and enter the Contextures blog giveaway contest, see how you do in the Alpha Geek Challenge!
_____________
After you create a calculated field in an Excel pivot table, you might want to remove it from the pivot table layout. You can temporarily remove a calculated field, or you can permanently remove it.
In this example, the pivot table has a calculated field named Bonus. It appears in the Values area as Sum of Bonus. You could hide the Bonus calculated field, or delete it from the pivot table.
Temporarily Remove a Calculated Field
To temporarily remove a calculated field from a pivot table, follow these steps:
- In the pivot table, right-click a cell in the calculated field. In this example, we’ll right-click the Bonus field.
- In the popup menu, click the Remove command that shows the name of the calculated field.
The calculated field is removed from the pivot table layout, but remains in the PivotTable Field List.
Later, you can add a check mark to the calculated field in the PivotTable Field List, to return it to the pivot table layout.
Permanently Remove a Calculated Field
To permanently remove a calculated field, follow these steps:
- Select any cell in the pivot table.
- On the Ribbon, under the PivotTable Tools tab, click the Options tab.
- In the Tools group, click Formulas, and then click Calculated Field.
- From the Name drop down list, select the name of the calculated field you want to delete.
- Click Delete, and then click OK to close the dialog box.
______________
For more information on Pivot Tables, please see the Pivot Table Tutorials on the Contextures Website.
______________
In an Excel 2007 pivot table, you can filter a date field by using the Date Filters option in the Row Labels drop down. For example, you can select all the dates between two specific dates, or filter for a dynamic range, such as Last Week.
However, when you use the row label date filters, you can only select a consecutive date range, or one specific date. You can’t select two or more nonconsecutive dates.
For example, in the screen shot above, the Work Date field is in the Row Labels area, and Labor Hours (Sum of LbrHrs) is in the Values area. In the Work Date field, you can’t use the Date Filters option to select to select January 13th, 17th and 21st.
Manually Select the Dates
Instead of using the date filter options, you can manually select items in the Row Labels drop down list. To manually filter dates in the Row Labels filter list, follow these steps:
- In the pivot table, click the arrow on the Row Labels heading.
- In the list of dates, remove the check mark from Select All, to remove all the check marks from the list.
- Add check marks to the dates you want to see, and then click OK.
The pivot table now shows results for work done on the selected dates, and you can focus on that data.
______________
For more information on Pivot Tables, please see the Pivot Table Tutorials on the Contextures Website.
______________
Sometimes when you add fields to the Values area of a pivot table, they appear as Count of Field instead of Sum of Field. In the screen shot below, the Quantity field shows the COUNT, and the TotalPrice field shows the SUM.
COUNT Summary Function
The COUNT summary function is the default if a field in the pivot table’s source data contains blank cells, or cells with text. For example, in a column of invoice dates, someone might have mistyped a month name, so it isn’t recognized as a valid date. Or, in a column of sales quantities, you might have typed “N/A”, instead of a number, or maybe you left a blank cell to fill in later.
In these cases, where the source column contains blank cells or text, the summary function defaults to Count; otherwise, it defaults to Sum.
Change the Summary Function
You can manually change the summary function from Count to Sum, after the Values fields have been added. Or, to make things easier, you can run a macro to change the summary function.
This sample macro changes all the Values fields in the first pivot table on the active sheet to use the Sum function (xlSum). The code refers to the pivot table by index number (1), instead of using a specific name ("PivotTable1"), and that makes the macro more flexible.
You can type this code on a regular code module in your workbook, and run it when you want to change the summary functions for all the Value fields.
Download the Sample File
You can download the Excel 2007 file with the Change Summary Function to Sum sample code.
The SumAllValueFields macro is stored on the modPivot code module in the sample file. You can run the macro in the sample file, or copy the Excel VBA code to a regular code module in another workbook, and run it there.
Pivot Table Add-in
Another option is to use my free pivot table add-in, that already has the summary function code in it. There’s a feature that changes all the Value fields to SUM, or any other summary function that you’d prefer. For example, you can change all the field to AVERAGE or COUNT, instead of SUM.
- After you download and install the pivot table add-in, select any cell in the pivot table.
- Then, on the Ribbon’s Add-Ins tab, click the Pivot drop down.
- Click Data Fields, then click the Summary function that you want to use. All the Value fields in the selected pivot table will change to that summary function

______________
P.S.: For more information on Pivot Tables, please see the Pivot Table Tutorials on the Contextures Website.
______________
When you create a pivot table in Excel 2007, a default PivotTable style is automatically applied to a pivot table. For example, in the screen shot below, the pivot table uses the Pivot Style Light 16.
Remove the Pivot Table Style
In some workbooks, you might prefer to have a pivot table with no fill color or header formatting. In the PivotTable Styles gallery, you can apply a special style to remove the existing style.
Follow these steps to clear the PivotTable style:
- Select a cell in the pivot table.
- On the Ribbon, click the Design tab.
- In the PivotTable Styles gallery, click the first style, None, at the top left of the Light styles.

Pivot Table Style Removed
After you click the None option, the existing style is removed, and a thin border remains around the pivot table sections. The worksheet gridlines, if displayed, are not visible within the pivot table.
Also, when no PivotTable style is applied, the preview function does not work if you point to a different style in the PivotTable Styles gallery.
Clear the Pivot Table Style
Another way to remove the PivotTable style is to click Clear, at the bottom left of the PivotTable Styles gallery.

______________
For more information on Pivot Tables, please see the Pivot Table Tutorials on the Contextures Website.
______________
Even though a pivot table is automatically formatted when you create it, you can add your own formatting later. For example, in the pivot table shown below, I’ve added colour to the subtotal rows, and made column B narrow.
However, some of that pivot table formatting might be lost if you refresh the pivot table or change its layout. Even if you select a different item in the report filter, the formatting could be lost.
Here’s what the same pivot table looks like, after I select an order date from the report filter.
Preserve the Formatting
Most pivot table formatting can be preserved if you change the Format options in the PivotTable Options dialog box.
- Right-click a cell in the pivot table, and click PivotTable Options.
- On the Layout & Format tab, in the Format options, remove the check mark from Autofit Column Widths On Update. This will prevent column widths from changing, if you have manually adjusted them.
- Add a check mark to Preserve Cell Formatting on Update
- Click OK.

Apply Formatting
After changing these Pivot Table options, the formatting should stick. When you apply formatting to the Pivot Table, do the following:
- Ensure that Enable Selection is turned on.
- Unless you want to format a single cell, use the pivot table selection technique to select the elements you want to format (point to the top or left edge of the element, and then click when the black arrow appears).
______________
P.S. For more information on Pivot Tables, please see the Pivot Table Tutorials on the Contextures Website.
_________________
In Excel 2003, you could drag fields from the PivotTable Field List onto the pivot table layout on the worksheet.
In Excel 2007, you can only move the fields to the areas in the PivotTable Field List. In the screen shot below, if you try to drag the Promo field onto the pivot table, the cursor shows an X. The drag-and-drop feature doesn’t work.
Change the Pivot Table Settings
If you’d like to drag the pivot fields onto the worksheet layout, you can change a setting in the pivot table options.
- Right-click a cell in the pivot table, and click PivotTable Options.
- On the Display tab, add a check mark to Classic PivotTable Layout.
- Click OK, to close the PivotTable Options dialog box.
Drag the Pivot Table Fields
After you change the setting, the pivot table on the worksheet shows a blue border around each region.
You can now drag the pivot fields from the PivotTable Field List onto the worksheet, or drag the fields to a different part of the pivot table.
- Point to a field label in the pivot table layout
- When the pointer changes to a four-headed arrow, drag the field label to a different area
You can use the same technique to drag fields into the pivot table layout from the PivotTable Field List, or drag field labels out of the pivot table layout.
Pivot Table in Tablular Form
When you change the setting to Classic PivotTable layout, the pivot table’s report layout automatically changes to Tabular form.
You can use Tabular form, or Outline form, with the Classic PivotTable layout. If you change to Compact form, the blue borders are still visible when the pivot table is active. However, you won’t be able to drag-and-drop the fields.
___________________
|
|