ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Data tools
  3. Conditional Formatting in a Pivot Table That Survives Refresh

Conditional Formatting in a Pivot Table That Survives Refresh

By ExcelReady Team·Updated November 3, 2026·6 min read

The short answer

To keep conditional formatting in a pivot table after a refresh, apply the rule to the value field, not to fixed cells. After you add the rule, click the Formatting Options button and choose "All cells showing 'Sum of Sales' values for 'Region'". The rule then follows the field as rows change, and it leaves out subtotals and grand totals.

Key takeaways

  • A rule scoped to 'Selected cells' covers fixed addresses, so it misses new rows after a refresh.
  • Scope rules to the value field instead; Excel offers this in the Formatting Options button and the Apply Rule To section.
  • The 'for Region' option leaves out subtotals and grand totals, which would otherwise distort averages, top 10 rules and colour scales.
  • Fix existing rules in Home > Conditional Formatting > Manage Rules, with 'This PivotTable' selected.
On this page+
  1. Why does pivot table conditional formatting break after a refresh?
  2. How to apply conditional formatting to a pivot table
  3. The three "Apply rule to" options explained
  4. Why you should leave out the grand total
  5. How to fix a rule that stopped working
  6. Which conditional formatting rules work best in a pivot?
  7. Common problems with pivot conditional formatting
  8. Practise it

Conditional formatting in a pivot table survives a refresh when the rule is tied to the value field, not to a block of fixed cells. Excel asks how to scope the rule each time you add one, and the choice decides whether new rows get coloured and whether the grand total spoils the result. This guide is for anyone who builds pivot reports that are refreshed every week and wants the highlights to keep working.

Why does pivot table conditional formatting break after a refresh?#

It breaks because the rule points at fixed cells while the pivot keeps changing shape. A normal conditional formatting rule applies to a range such as B5:B9. A pivot table can grow, shrink or move its values every time you refresh, filter or drag a field.

Say a rule covers B5:B9 for five regions. Next month a sixth region appears and the pivot fills B5:B10. B10 has no rule, so it stays plain. If you move Region to Columns, the values move to a row and the old range now highlights the wrong cells, or empty ones.

Pivot tables solve this with field-based scopes. A rule scoped to "Sum of Sales" follows those values wherever they appear. If refreshing itself is the problem, see why a pivot table doesn't update and how to refresh it.

How to apply conditional formatting to a pivot table#

Apply the rule as usual, then change its scope:

  1. Click one value cell in the pivot, for example the Sum of Sales for Central.
  2. Go to Home > Conditional Formatting and pick a rule, such as Top/Bottom Rules > Above Average or Data Bars.
  3. A small Formatting Options button appears next to the cell. Click it.
  4. Choose All cells showing "Sum of Sales" values for "Region".

The rule now covers every region value, today and after any refresh. If you create the rule from Conditional Formatting > New Rule instead, the same three choices appear at the top of the dialog under Apply Rule To. The basics of each rule type are in the conditional formatting guide.

The three "Apply rule to" options explained#

Excel gives you three scopes. The names use your own field names, so they change with your data:

OptionWhat it coversSurvives refresh?Includes totals?
Selected cellsThe exact cells you selectedNo: new rows are missedOnly if you selected them
All cells showing "Sum of Sales" valuesEvery Sum of Sales cell in the pivotYesYes: subtotals and grand totals too
All cells showing "Sum of Sales" values for "Region"Sum of Sales cells at the Region levelYesNo

The third option is the right default for most reports. Use the second only when you really want totals compared with items, which is rare.

If your pivot has two row fields, such as Region and Month, the third option is tied to the level of the cell you clicked. Click a month value first and the rule covers the month rows, not the region subtotals.

Why you should leave out the grand total#

Rules such as Above Average, Top 10 and colour scales compare every cell in their range, and a grand total is far bigger than any single item. Here is a pivot of sales by region:

RegionSum of Sales
Central18,400
East22,750
North15,900
South26,300
West19,650
Grand Total103,000

With the third option, the average of the five regions is 20,600, so Above Average highlights two regions: East and South. You can check that count with a formula on the values:

Excel formula
=COUNTIF(B2:B6,">"&AVERAGE(B2:B6))

The result is 2. With the second option, the grand total joins the range. The average of all six cells becomes 34,333, and the only cell above it is the grand total itself. The rule "works", but it tells you nothing. The same happens with a colour scale: the total takes the darkest colour and every region looks pale.

How to fix a rule that stopped working#

You can rescope an existing rule without starting again:

  1. Click any cell inside the pivot.
  2. Go to Home > Conditional Formatting > Manage Rules.
  3. In Show formatting rules for, choose This PivotTable.
  4. Select the rule and click Edit Rule.
  5. Under Apply Rule To, pick the field-based option and click OK.

While you are in Manage Rules, delete duplicates. Applying a rule to "Selected cells" several times over the months often leaves a stack of near-identical rules. The rules list also shows the order Excel applies them in, which matters when two rules colour the same cell.

Which conditional formatting rules work best in a pivot?#

Most rule types work in a pivot. These are the ones that read best in a report:

  • Data bars show size at a glance. Leave totals out or every bar looks short.
  • Top 10 Items or Top 10% pick out the leaders. You can change 10 to 3 for a top-three highlight.
  • Above or below average split items into two groups.
  • Greater than a value flags anything over a target, such as sales above 20,000.
  • Icon sets work well with a "% of total" value field, where every item is on the same scale. The guide to showing percent of total in a pivot table sets that up.

Formula rules work too. Choose Use a formula to determine which cells to format, write the formula for the cell you clicked, such as =B5>20000, and then pick the field-based scope. Rules can also target a calculated field; the guide to pivot table calculated fields shows how to add one.

Common problems with pivot conditional formatting#

If the colours still look wrong, check these:

  1. The value field was removed and added back. Removing a field from the pivot removes its rules. Add the rule again after the layout is final.
  2. The rule colours dates or labels. Rules on row labels need the "Selected cells" scope or a formula rule. For grouped dates, see how to group dates in a pivot table.
  3. The rule depends on a filter. A Top 3 rule ranks only the items currently visible, so filtering the pivot changes which items are highlighted. That is usually what you want.
  4. Manual colours fight the rule. "Preserve cell formatting on update" in PivotTable Options keeps manual fills, not conditional formatting. Clear manual fills so the rule is the only source of colour.

Practise it#

The skills behind this are conditional formatting rules and confident pivot work. Practise conditional formatting in a live spreadsheet, then build and rearrange summaries in the pivot tables lesson. Each lesson checks your work instantly. The exercise on this page shows how to confirm what an Above Average rule will highlight.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

This is a pivot's output with the grand total left out. An Above Average rule highlights regions whose sales beat the average. In D2, count how many regions it highlights: use COUNTIF on B2:B6 with ">"&AVERAGE(B2:B6) as the criteria.

fx
ABCDE
1
Region
Sum of Sales
Highlighted
2
Central
18400
3
East
22750
4
North
15900
5
South
26300
6
West
19650
7
8
9

Tip: Join the operator to the average with &: ">"&AVERAGE(B2:B6).

Practise this in a lesson

LessonConditional formattingMake important numbers stand out: highlight values over a limit, duplicate IDs and the top 3, then color whole rows with a formula rule and a $ on the column.LessonPivot tables 2Go further with PivotTables: nest two row fields with subtotals, add a report filter, show values as a % of the grand total, update the source when new rows arrive, and know when SUMIFS is the better tool.

Frequently asked questions

Why does conditional formatting disappear when I refresh my pivot table?

+

The rule was probably applied to selected cells, which are fixed addresses. When the pivot changes size or layout, those cells no longer match the data. Edit the rule and apply it to all cells showing the value field instead.

How do I apply conditional formatting to a pivot table without the grand total?

+

Apply the rule, then choose the third option under Formatting Options or Apply Rule To: All cells showing 'Sum of Sales' values for 'Region'. That scope covers the item rows only and leaves out subtotals and grand totals.

Can I use a formula in pivot table conditional formatting?

+

Yes. Choose 'Use a formula to determine which cells to format' and write the formula for the active cell, such as =B5>20000. Then set Apply Rule To to the value field so the rule follows the pivot.

Does Preserve cell formatting on update keep conditional formatting?

+

No. That PivotTable option keeps manual formatting, such as fill colours you set by hand. Conditional formatting depends on how the rule is scoped, so scope it to the value field.

Sources

  • Use conditional formatting to highlight information - Microsoft Support
  • Create a PivotTable to analyze worksheet data - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. Why does pivot table conditional formatting break after a refresh?
  2. How to apply conditional formatting to a pivot table
  3. The three "Apply rule to" options explained
  4. Why you should leave out the grand total
  5. How to fix a rule that stopped working
  6. Which conditional formatting rules work best in a pivot?
  7. Common problems with pivot conditional formatting
  8. Practise it

Keep reading

Data tools· 5 min read

How to Refresh a Pivot Table (and Why It Doesn't Update)

To refresh a pivot table, right-click anywhere in it and choose Refresh, or press Alt+F5 on Windows. Use Data > Refresh All (Ctrl+Alt+F5) to update every pivot in the file. If new rows still don't appear, they're outside the source range: use PivotTable Analyze > Change Data Source, or build the pivot on an Excel table so the range grows.

Data tools· 6 min read

Pivot Table Tricks: Subtotals, Filters and % of Total

To show a percent of total in a pivot table, click the ▾ on the field in the Values area, choose Value Field Settings, open Show Values As and pick % of Grand Total. Each number then shows its share of the total, and the parts add up to 100%. You can also right-click a value and choose Show Values As.

Data tools· 5 min read

Conditional Formatting in Excel: Highlight What Matters

Conditional formatting colors cells automatically when they meet a rule. Select the cells, go to Home > Conditional Formatting, and pick a rule such as Highlight Cells Rules > Greater Than. To color whole rows, use New Rule > Use a formula, with a $ before the column letter: =$E2>5000. Rules update whenever values change.

More on data tools

  • Count in a Pivot Table: Count vs Distinct Count
  • Group Dates by Month or Year in a Pivot Table
  • Group Numbers Into Ranges in a Pivot Table
  • How to Make a Pivot Table From Multiple Sheets in Excel
  • Remove a Grand Total or Subtotal From a Pivot Table
  • How to Sort a Pivot Table in Excel
All data tools articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free