Quick, clean, and to the point

Pivot table conditional formatting

To apply conditional formatting to a pivot table, create a new conditional formatting rule and pay particular attention to the "apply rule to" settings as described below. In the example shown, there are two rules applied. The green shows the top 5 values using a rule like this:

Pivot table conditional formatting top 5 values rule


Pivot tables are dynamic and change frequently when data is updated. If you created conditional formatting rules based on "selected cells" only, you may may find that the conditional formatting is lost or not applied to all data when the pivot table is changed, or when data is refreshed.

The best option is to set up the the rule correctly from the start. Select any cell in the data you wish to format and then choose "New rule" from the conditional formatting menu on the Home tab of the ribbon. At the top of the window, you will see setting for which cells to apply conditional formatting to. For the example shown, we want:

"All cells showing sum of "sales values" for name and "date"

Pivot table conditional formatting create new rule

Note: selecting "All cells showing sum of "sales values" will include grand total rows and columns as well, which you ordinarily don't want.

Editing existing rules to fix broken formatting

If you already have a rule set up that is not correctly formatting all values as needed, edit the rule and change the cell selection option if needed. You can access existing rules at Home > Conditional Formatting > Manage Rules.

In the example shown, the rule manager displays two rules like this:

Pivot table conditional formatting rule manager

To edit a rule, select the rule and click the "Edit Rule" button. Then adjust settings in the "Apply rule to" section.

Note: conditional formatting is lost when you remove the target field from a pivot table.

Pivot Table Training

If you use Excel, but don't know how to use Pivot Tables, you're missing out...wasting time trying to do things that a Pivot Table can do for you automatically. Core Pivot is a step-by-step Excel video course that will teach you everything you need to know to use this powerful tool. With a small investment, Pivot Tables will pay you back again and again. See details here.