
IBM Certified Data Scientist (2020), previously Petroleum Geologist/Geomodeler of oil and gas fields worldwide with 12+ years of international work experience. Proficient in Python, R, and SQL. Areas of expertise: data cleaning, data manipulation, data visualization, data analysis, data modeling, statistics, storytelling, machine learning. Extensive experience in managing data science communities and writing/reviewing articles and tutorials on data science and career topics.
FAQs
How do you apply conditional formatting to a PivotTable in Excel?
Select a cell in the PivotTable, open the Home tab, and click Conditional Formatting. Choose a predefined rule and format, or click Manage Rules to build a custom rule with the New Rule button and set the format manually. Both methods start the same way.
What's the difference between the two conditional formatting methods for PivotTables?
The first method uses predefined rule types and formats accessed directly from the Conditional Formatting button, making it faster and more intuitive. The second method uses the Rules Manager, which is more customizable and lets you view, edit, and manage every existing rule in one place.
Why does conditional formatting disappear from a PivotTable?
Conditional formatting is lost when a field it was applied to gets removed from the PivotTable. Rearranging the layout or applying filters and slicers does not break the formatting, since it stays valid as long as the formatted fields remain in the table.
Do you need to refresh a PivotTable after updating the source data for formatting to work?
Yes. Conditional formatting is applied directly to the PivotTable itself, not to the underlying Excel source table, so changes made to that source data require refreshing the PivotTable before the updated conditional formatting is correctly reflected in the cells.
Where can you learn Excel skills like PivotTables and conditional formatting?
DataCamp's Introduction to Excel course covers the basics, while the Data Analysis in Excel course builds on that with PivotTables and related techniques. Both are suited to readers who want to go beyond manual spreadsheet work into more structured analysis.



Applying conditional formatting to PivotTables adds value to our data analysis by visually highlighting the most critical data points and enhancing the readability of those tables.
In this tutorial, we'll learn two methods for applying conditional formatting to PivotTables in Excel. We'll also list some nuances and potential issues to keep in mind and how to handle them.
If you need a quick revision of the basics of Excel, our Introduction to Excel course can be a helpful resource for you.
How to Apply Conditional Formatting to PivotTables
There are two methods for applying conditional formatting to PivotTables in Excel:
Both methods start with:
The first method is more intuitive and provides preset formats for each rule. The second method is a little more customizable and allows accessing all options, settings, and already-created rules from one place.
To practice both methods, in this tutorial, we're going to work with the below PivotTable based on the source table from Kaggle—Credit Card Spending Habits in India:
Method 1: Using the PivotTable formatting icon
Let's see how to implement the first method: choosing from the predefined rule types, rules, and formats.
You can customize things like the rule type, condition (e.g., greater than or top 10), font color, cell fill color, number formatting, and even icon sets.
Choosing from the predefined conditional formatting rules. Image by Author
Choosing from the predefined formats. Image by Author
Opening the formatting options. Image by Author
Expanding a conditional formatting rule to all cells. Image by Author
Method 2: Using the Conditional Formatting rules manager
Now, let’s practice applying conditional formatting to our PivotTable by using the second method: setting a rule type, a rule, and a format in a dedicated rule manager.
Opening the Conditional Formatting Rules Manager. Image by Author
Creating a new rule in the Conditional Formatting Rules Manager. Image by Author
Expanding a conditional formatting rule to all cells. Image by Author
Selecting a rule type, building a rule, and opening the format constructor. Image by Author
Setting format details. Image by Author
Confirming the creation of a new rule. Image by Author
Things To Keep in Mind
Refreshing a PivotTable with conditional formatting after updating the source table. Image by Author
Conclusion
Now it's your turn to practice and experiment with different conditional formatting techniques that can work better in other cases. Our Data Analysis in Excel course is a great place to continue mastering your skills.