30 Advanced Excel Tips for 2026

Excel Champs / Pivot Table / How to Apply Conditional Formatting to a Pivot Table in Excel
By Puneet Gogia (Microsoft MVP)

How to Apply Conditional Formatting to a Pivot Table in Excel

30+ Advanced Excel Tips for 2026

No spam. Only Excel Stuff. God Promise. 😊

Click a value cell inside the pivot table and go to Home → Conditional Formatting → New Rule. Under Apply Rule To, choose the third option, All cells showing “Sum of Amount” values for …, which names your row and column fields. Pick the rule type and format, then click OK.

The third option ties the rule to the field rather than to cell addresses, so the formatting stays on the right values when you refresh, add new data or filter. Every rule type works with it: colour scales, data bars, icon sets, Format only top or bottom ranked values and Format only cells that contain → Blanks.

The rule is re-evaluated against the values that are visible, so a top-value highlight or colour scale updates as you filter with a slicer or timeline. To compare against a target held in a cell, set the data bar Maximum type to Number and enter a reference such as =$E$2 as the value.

If the Apply Rule To options are missing, the active cell was usually outside the pivot table’s values when you opened New Rule. Click a value cell and open it again. After a quick rule from the Conditional Formatting menu, the Formatting Options button beside the cells offers the same three choices.

The silent failure is picking the wrong scope. Selected cells sticks to fixed addresses, so the formatting lands on the wrong cells once rows or columns move. The second option, All cells showing “Sum of Amount” values, also formats subtotals and grand totals, which squashes a colour scale or data bars because the totals become the maximum. Use the third option to keep totals out.

You know that the pivot table is one of the most important tools to analyze and summarize data.

Pivot tables can be used to create instant reports. To make them more appealing, conditional formatting can be applied to them.

Look below, where I applied conditional formatting in a pivot table to highlight cells.

Filtering any state with a slicer will highlight the city with the highest and the lowest amount.

In this post, you will learn how to apply conditional formatting to a pivot table and all the possible ways to use it.

Note: Pivot tables are one of the INTERMEDIATE EXCEL SKILLS.

Steps to Apply Conditional Formatting to a Pivot Table

Applying conditional formatting in a pivot table seems tricky at first, but it’s simple and easy.

In the pivot table below, you need to apply a “3-Color Scale” to the monthly amounts. Let’s follow these steps.

color-scale-conditional-formatting-in-pivot-table
  1. First of all, select any of the cells which have a monthly amount.
    select cell to conditional formatting in pivot table
  2. Then, go to Home Tab → Styles → Conditional Formatting → New Rule
    select new rule to apply conditional formatting in pivot table
  3. Here, you will get a pop-up window to apply conditional formatting to the pivot table.
    pop window to apply conditional formatting in pivot table
  4. In this pop-up window, under “Apply Rule To”, you have three different options to apply conditional formatting in a pivot table.
    • Selected cells: Use this option to apply conditional formatting only to the selected cells.
    • All Cells Showing “Amount” Values: All the cells which have amount values.
    • All Cells Showing “Amount” Values For “Month”: All cells which have amount values, but only at the Month level (not the subtotals or grand totals).
      three options to apply conditional formatting in pivot table
  5. Select All Cells Showing “Amount” values for “Month”.
  6. In “Edit the Rule Description” select 3-Color Scale.
  7. Change the type of minimum, midpoint, and maximum to Percent. After that, choose a color for all three.
    select options to apply conditional formatting in pivot table
  8. In the end, click OK.
    pivot table with conditional formatting in pivot table

In the above pivot table, you have applied a 3-color scale to the cells with monthly amounts. Using this formatting, you can easily analyze which month has more revenue than others.

Related: The Complete Guide to Conditional Formatting in Excel

Examples: Apply Conditional Formatting in a Pivot Table

Using conditional formatting in a pivot table is smart, and you can use it in different ways. Here is a list of examples you can learn and apply instantly to your work.

1. Dynamic Conditional Formatting with Filters

When you use conditional formatting in your pivot, it works as dynamic formatting. Whenever you filter values or change data, the formatting automatically updates with that change.

dynamic conditional formatting in pivot table

In the above pivot table, you have applied conditional formatting to highlight the cell with the highest value.

When you click on 2014, Product B has the highest sales quantity, and for 2015, Product C has the highest sales quantity.

When you filter your pivot table, it automatically considers the current values and applies the formatting rule.

Related: Excel Slicer

2. Apply Conditional Formatting on a Single Row in a Pivot Table

You will find product and week-wise sales data in the pivot table below. Here, you can highlight the cell with the highest sales quantity for a particular product.

apply conditional formatting in pivot table in rows
  1. Select any of the cells.
    select cell to apply conditional formatting in pivot table in row
  2. Go to Home Tab → Styles → Conditional Formatting → New Rule.
  3. From “Apply Rule To”, select the third option.
  4. And, from “Select a Rule Type”, select “Format only top or bottom ranked values”.
  5. In “Edit the Rule Description”, enter 1 in the input box, and from the drop-down menu, select “each Column Group”.
    highlight top values from a row by using conditional formatting in pivot table
  6. Apply the formatting you want.
  7. Click OK.
    conditional formatting in pivot table for highlighting rows

When you select “each Column group” (Rows), conditional formatting will compare values only from a row.

If you want to apply this rule to columns instead of rows, you can select “each Row Group” from the rule description.

If you want the rule to apply to all cells, select “all values” from the drop-down list.

3. Conditional Formatting in a Pivot Table Based on Another Cell

In the pivot table below, you need to apply data bars. But here is a twist: You have a target value in a different cell, and you need to apply data bars to compare it to that target value.

conditional formatting in pivot table using another cell

Here are the steps you need to follow.

  1. First of all, select a cell and go to Home Tab → Styles → Conditional Formatting → New Rule.
  2. Then, select the third option from “Apply Rule To” and select “Format all cells based on their values” from rule type.
  3. Now, in the rule description, select “Data Bar”, and in the Type drop-down menu, select Number for both Minimum and Maximum.
  4. From here, in the Minimum value box, enter 0, and in the Maximum value box, enter the cell reference as a formula: =$E$2.
    apply conditional formatting in pivot table to apply data bars
  5. In the end, specify the formatting you want for the data bars and click OK.
    use conditional formatting in pivot with another cell for data bars

4. Apply Conditional Formatting on Pivot Table Subtotals

The pivot table below shows sales amounts for the different months and quarters and subtotals for each quarter.

Here, you need to apply conditional formatting (Icon Set) to the subtotals instead of the month values.

Follow these steps:

apply icons to subtotal to use conditional formatting in pivot table
  1. First, select a cell and go to Home Tab → Styles → Conditional Formatting → New Rule.
  2. Then, select the third option from “Apply Rule To” and select “Format all cells based on their values” from the rule type.
  3. In the rule description, select “Icon Sets” and select an icon style.
  4. In the icon display rules, keep the type as Percent.
  5. In the end, click OK.

When you apply these icon sets to subtotals, the lowest subtotal is treated as 0% and the highest as 100%, and each subtotal gets a percent based on where it falls between them.

Cells at 67% or higher will get a green icon, cells from 33% up to 67% will get a yellow icon, and cells below that will get a red icon.

You can change icons and percentage values as per your needs.

5. Apply Conditional Formatting on Blank Cells in a Pivot table

The best way to highlight blank cells is by using conditional formatting, which you can also use in a pivot table.

In the pivot table below, some cells are blank, and you need to apply conditional formatting to those cells where there is no sale.

highlight blank cells by using conditional formatting in pivot table

Follow these simple steps.

  1. Select a cell in the values area, click on New Rule in conditional formatting, and select the third option in “Apply Rule To”.
  2. Select the rule type “Format only cells that contain” and select “Blanks” in the rule description.
    apply conditional formatting in pivot table for blank cells
  3. Apply cell color for formatting and click OK.
    conditional formatting in pivot table with blank cells highlighted

Points to Take Care of While Applying Conditional Formatting

  • Get the Basics Right: Understand how conditional formatting works before applying it to a pivot table. Conditional formatting allows you to automatically apply colors, bold, and italics to specific cells based on their values.
  • Apply Formatting to Values: Conditional formatting can be applied to the values area of a pivot table to highlight specific results. It can help identify trends or outliers in your data.
  • Caution with Grand Totals: Be cautious when applying conditional formatting to grand totals or subtotals, as the conditions may not make sense when applied to these totals.

Keep the Formatting After Refresh

If you apply conditional formatting to “Selected cells” only, it may get lost or end up on the wrong cells when the pivot table changes after a refresh or a new filter. That’s why it’s better to use the second or third option in “Apply Rule To”, which ties the rule to the field and not to the cell address.

And if you have already applied a rule with the normal conditional formatting options, look for the small Formatting Options button that appears next to the cells, and pick one of the pivot options from there. You can also change “Apply Rule To” later from Conditional Formatting ➜ Manage Rules ➜ Edit Rule.

Use a Formula Rule in a Pivot Table

You can also use “Use a formula to determine which cells to format” in a pivot table. Write the formula for the first cell of the values area, and Excel applies it to the other cells. For example, if the first amount cell is B5 and the target is in E2, this formula highlights the amounts below the target:

=B5<$E$2

Frequently Asked Questions

Why does conditional formatting disappear from my pivot table?

The rule was applied to the selected cells only. Edit the rule in Manage Rules and choose one of the “All cells showing…” options in “Apply Rule To”, so it follows the field when the pivot table changes.

How do I leave the grand total out of the formatting?

Use the third option, “All cells showing … values for …”. It applies the rule only to the cells at that field level, so the subtotals and grand totals don’t change the colors of the other cells.

How do I remove conditional formatting from a pivot table?

Select a cell in the pivot table and go to Home ➜ Conditional Formatting ➜ Clear Rules ➜ Clear Rules from This PivotTable.

3 thoughts on “How to Apply Conditional Formatting to a Pivot Table in Excel”

  1. Is there a way to apply conditional formatting based on the results in the Value fields. For instance, in the last example with the Product A thru J, can you highlight the name of the Product that had no sales in December? In other words, Product-C would be highlighted in red as well as its corresponding Dec cell where it shows that product had no sales.

    Reply
  2. If I have a Pivot Table with columns that will change based on the data input how can I conditional format. It appears that the formatting is linked to certain cells but if I add a column and it shifts the others my formatting will be wrong.

    Is there a way to fix this? have excel look at what the column name is and row name is and format based on that?

    Reply
  3. I don’t get that option to apply to what cells – I always only get the regular formatting text box. Using ecel 2013

    Reply

Leave a Comment