Conditional Formatting in Excel: Complete Visual Guide
What is Conditional Formatting?
Conditional formatting automatically applies visual formatting (colors, icons, data bars) to cells based on their values or formulas. It makes patterns and trends in your data immediately visible.
1. Getting Started with Conditional Formatting
Home Tab → Conditional Formatting Menu
Click "Conditional Formatting" to access all formatting options
Accessing Conditional Formatting
- Select the cells you want to format
- Go to Home tab → Conditional Formatting
- Choose from the dropdown menu options
Important:
Select your data range BEFORE applying conditional formatting. You can always modify the range later, but it's easier to get it right from the start.
Types of Conditional Formatting
Highlight Cell Rules
Color cells based on their values (greater than, less than, between, equal to, etc.)
Top/Bottom Rules
Highlight the highest or lowest values, or top/bottom percentages
Data Bars
Add horizontal bars inside cells to show relative values
Color Scales
Apply gradient colors from low to high values
Icon Sets
Display icons (arrows, traffic lights, etc.) based on value ranges
Custom Formulas
Create complex rules using your own formulas
2. Highlight Cell Rules
Example: Sales Performance Analysis
Before: Raw Data
Sales Rep | Q1 Sales |
---|---|
John | $95,000 |
Sarah | $87,000 |
Mike | $92,000 |
Lisa | $78,000 |
Tom | $65,000 |
Hard to spot patterns quickly
After: With Conditional Formatting
Sales Rep | Q1 Sales |
---|---|
John | $95,000 |
Sarah | $87,000 |
Mike | $92,000 |
Lisa | $78,000 |
Tom | $65,000 |
Result: Instantly identify top performers (green), average performers (yellow), and those needing support (red)
Highlight cell rules are the most commonly used conditional formatting. They color cells based on comparison operators (greater than, less than, equal to, etc.).
Available Rule Types
Greater Than
Highlight cells with values above a threshold
Less Than
Highlight cells with values below a threshold
Between
Highlight cells within a range
Equal To
Highlight cells with specific values
Text That Contains
Highlight cells containing specific text
Duplicate Values
Find and highlight duplicate or unique values
Step-by-Step: Highlight High Values
- Select your data range (e.g., B2:B20 for sales figures)
- Home → Conditional Formatting → Highlight Cell Rules → Greater Than
- Enter your threshold value (e.g., 10000)
- Choose formatting (color and fill)
- Click OK
3. Top/Bottom Rules
Top/Bottom rules automatically identify and highlight the highest or lowest values in your dataset, either by count or percentage.
Rule Options
Top 10 Items
Highlight the highest N values
Top 10%
Highlight the top percentage of values
Bottom 10 Items
Highlight the lowest N values
Bottom 10%
Highlight the bottom percentage of values
Practical Example: Sales Performance
Identify your top and bottom performers:
- Select sales data column
- Apply "Top 10%" rule with green formatting
- Apply "Bottom 10%" rule with red formatting
- Result: Best and worst performers are immediately visible
4. Data Bars and Color Scales
Data Bars
Data bars add horizontal bar charts directly inside cells, making it easy to compare values at a glance.
Data Bar Types
- Gradient Fill: Bars with gradient shading
- Solid Fill: Bars with solid colors
- Positive/Negative: Different colors for positive and negative values
When to Use Data Bars:
- Comparing sales figures across regions
- Showing progress toward goals
- Visualizing survey ratings
- Displaying budget vs. actual spending
Color Scales
Color scales apply gradient colors from one shade to another, creating heat map-style visualizations.
Red-Yellow-Green
Classic traffic light colors
Blue-White-Red
Great for temperature or variance data
Green-White
Two-color scale for simpler visualization
Color Scale Tips:
- Use 2-color scales for simple good/bad comparisons
- Use 3-color scales when you have a meaningful midpoint
- Ensure colors are accessible (consider colorblind users)
5. Icon Sets
Icon sets display small graphics (arrows, traffic lights, stars, etc.) in cells based on value ranges. They provide quick visual cues about performance or status.
Popular Icon Sets
3 Arrows
↑ ↔ ↓
Up, sideways, down arrows
3 Traffic Lights
🟢 🟡 🔴
Green, yellow, red circles
3 Flags
🟢 🟡 🔴
Green, yellow, red flags
4 Arrows
↑ ↗ ↘ ↓
More granular direction indicators
5 Quarters
● ◐ ◑ ◕ ○
Filled circles showing progress
3 Stars
★ ☆ ☆
Rating system display
Customizing Icon Rules
You can customize when each icon appears:
- Apply an icon set to your data
- Go to Conditional Formatting → Manage Rules
- Edit the rule and click "Edit Rule"
- Adjust the thresholds for each icon
- Choose percentage, number, or percentile basis
6. Custom Formulas
Custom formulas give you complete control over conditional formatting. You can create complex rules that aren't available in the preset options.
Creating Formula-Based Rules
- Select your data range
- Conditional Formatting → New Rule
- Choose "Use a formula to determine which cells to format"
- Enter your formula (must return TRUE/FALSE)
- Set the formatting
- Click OK
Formula Examples
Highlight Entire Rows
Highlight entire row if Column A contains "Complete":
=$A2="Complete"
Apply to range: $A$2:$Z$100
Highlight Weekends
Highlight dates that fall on weekends:
=OR(WEEKDAY(A2)=1,WEEKDAY(A2)=7)
Apply to your date range
Alternating Row Colors
Create zebra striping for better readability:
=MOD(ROW(),2)=0
Colors every even row
Compare Columns
Highlight when actual exceeds budget:
=C2>B2
Where C2 is actual, B2 is budget
Highlight Based on Another Cell
Highlight if corresponding status is "Overdue":
=D2="Overdue"
Apply to any range, will check column D
Formula Tips:
- Use absolute references ($) when you want to lock a column or row
- Use relative references when you want the formula to adjust for each cell
- Test your formula in a cell first to make sure it works
- Remember that the formula must return TRUE or FALSE
Practice with Conditional Logic
Conditional formatting uses formulas that return TRUE or FALSE. Practice creating these formulas below. Try entering comparison formulas in column C to check if scores meet certain criteria:
Instructions:
- Column A contains student names
- Column B contains their test scores
- In column C, enter formulas to check conditions:
- For C2: Enter
=B2>80
to check if score is greater than 80 - For C3: Enter
=B3<60
to check if score is less than 60 - For C4: Enter
=B4=100
to check if score equals 100 - The formulas will return TRUE or FALSE
- In real Excel, these TRUE/FALSE results would trigger conditional formatting
💡 Remember:
These formulas return TRUE or FALSE, which is exactly what conditional formatting uses behind the scenes to decide whether to apply formatting!
7. Managing Rules
As you add more conditional formatting rules, you'll need to manage them effectively. Excel provides tools to view, edit, and prioritize your rules.
Conditional Formatting Rules Manager
Access via: Home → Conditional Formatting → Manage Rules
Manager Features:
- View all rules: See every rule applied to the current selection
- Edit rules: Modify existing rules without starting over
- Delete rules: Remove rules you no longer need
- Change priority: Reorder rules using up/down arrows
- Stop if true: Prevent lower-priority rules from applying
Rule Priority and Conflicts
Understanding Priority:
- Rules at the top of the list have higher priority
- If multiple rules apply to the same cell, higher priority wins
- Use "Stop If True" to prevent conflicts
- Be careful with overlapping ranges
Copying and Clearing Formatting
Copy Formatting
- Select cell with formatting
- Copy (Ctrl+C)
- Select destination
- Paste Special → Formats Only
Clear Formatting
- Select range
- Conditional Formatting → Clear Rules
- Choose scope (selection, sheet, table)
8. Practical Examples
Example 1: Project Status Dashboard
Goal: Create a visual project tracking system
Setup:
- Column A: Project Name
- Column B: Status (Not Started, In Progress, Complete, Overdue)
- Column C: Progress % (0-100)
- Column D: Due Date
Formatting Rules:
- Status Colors: Green=Complete, Yellow=In Progress, Red=Overdue
- Progress Bars: Data bars in Column C (0-100%)
- Overdue Highlighting: Highlight entire row if due date < today AND status != Complete
Example 2: Sales Performance Heat Map
Goal: Visualize sales performance across regions and months
Data Structure:
- Rows: Sales regions
- Columns: Months (Jan-Dec)
- Values: Sales figures
Formatting:
- Color Scale: Red-Yellow-Green for all sales data
- Top 10%: Bold border for highest performers
- Bottom 10%: Red background for lowest performers
Example 3: Budget Variance Analysis
Goal: Quickly identify budget overruns and underruns
Columns:
- A: Department
- B: Budget
- C: Actual
- D: Variance (=C2-B2)
- E: Variance % (=D2/B2)
Formatting Rules:
- Variance: Green for negative (under budget), red for positive (over budget)
- Data Bars: Show variance magnitude
- Icon Set: Traffic lights for variance % (green <5%, yellow 5-10%, red >10%)
Practice Challenge: Student Grade Tracker
Create a comprehensive grade tracking system:
Data Structure:
- Student names
- Assignment scores (0-100)
- Final grades (A-F)
- Attendance %
Formatting Goals:
- Color code letter grades
- Highlight low attendance
- Show score distributions
- Identify struggling students
Best Practices and Tips
Do's ✓
- Keep formatting simple and meaningful
- Use consistent color schemes
- Test with different data values
- Consider colorblind accessibility
- Document complex formula rules
- Use descriptive rule names
Don'ts ✗
- Don't overuse colors and effects
- Don't create conflicting rules
- Don't ignore rule priority
- Don't forget to test edge cases
- Don't make rules too complex
- Don't apply to entire columns unnecessarily
Ready for the Next Step?
Continue your Excel journey with: INDEX MATCH vs VLOOKUP: Complete Comparison