Conditional Formatting in Excel: How to Apply Rules and Custom Formats
Learn how to use conditional formatting in Excel to highlight cells, create color scales, apply data bars, and build custom rules based on formulas.

What Is Conditional Formatting in Excel?
Every spreadsheet eventually reaches the point where the raw numbers alone aren't enough — you need visual cues to make sense of what you're looking at. That's where conditional formatting comes in. Instead of manually scanning columns of figures or highlighting cells by hand, you set rules and let Excel handle the formatting automatically. Change a number, and the cell's appearance instantly reflects whether it's above a target, below average, or a duplicate. It's the difference between a wall of text and data that tells you something at a glance.
Conditional formatting in Excel automatically changes the appearance of cells based on their values — highlighting numbers above a threshold, flagging duplicates, applying colour scales to show relative magnitude, or adding data bars that visually represent the size of each value. It's one of Excel's most practical features for making data readable at a glance, and it works without changing the underlying data. The formatting updates dynamically: if a cell's value changes to meet (or stop meeting) the condition, the formatting adjusts immediately.
You've probably used conditional formatting without thinking about it formally. Any time you want to draw attention to specific values in a spreadsheet — overdue invoices, failing test scores, cells that exceed a budget, duplicate entries in a list — conditional formatting is the tool. It replaces the tedious process of manually scanning rows of numbers and applying colour by hand, which doesn't scale and goes stale the moment data changes.
Excel provides several categories of conditional formatting rules. The built-in options — Highlight Cells Rules, Top/Bottom Rules, Data Bars, Color Scales, and Icon Sets — handle the most common scenarios without any formula knowledge. For situations where built-in rules don't fit, you can write custom rules using Excel formulas, which opens up virtually unlimited formatting possibilities. You can format cells based on the value of another cell, based on whether a date falls within a range, based on the combination of multiple conditions, or based on any logical expression you can express in a formula.
This guide covers all the built-in conditional formatting options, walks through creating custom formula-based rules, explains how to manage and troubleshoot rules, and addresses the common mistakes that trip up Excel users when working with conditional formatting for the first time.
- Where to find it: Home tab → Conditional Formatting (in the Styles group)
- Highlight Cells Rules: Format cells greater than, less than, between, equal to, containing text, or duplicates
- Top/Bottom Rules: Format the top 10, bottom 10, above average, or below average values
- Data Bars: Add horizontal bars inside cells proportional to the cell value
- Color Scales: Apply a gradient (2 or 3 colours) across a range based on value distribution
- Icon Sets: Display directional arrows, traffic lights, stars, or flags based on value thresholds
- Custom rules: Use a formula to determine which cells to format — supports any Excel formula that returns TRUE/FALSE
- Multiple rules: You can apply multiple conditional formatting rules to the same range — rules are evaluated in priority order
How to Apply Conditional Formatting: Step by Step
Step 1: Select the Range You Want to Format
Step 2: Go to Home → Conditional Formatting
Step 3: Choose a Rule Type
Step 4: Verify and Adjust

Built-in Conditional Formatting Rules Explained
Excel's built-in conditional formatting rules handle the majority of everyday formatting needs without requiring any formula knowledge. They're fast to apply and easy to understand.
Highlight Cells Rules are the most frequently used category. 'Greater Than' highlights cells with values above a threshold — useful for flagging values that exceed a budget, a deadline, or a performance target. 'Less Than' does the opposite. 'Between' highlights cells within a specified range, which works well for acceptable-range indicators. 'Equal To' highlights exact matches.
'Text That Contains' highlights cells containing a specific word or phrase, regardless of what else is in the cell — handy for scanning text columns for specific entries like status labels or category names.
'Duplicate Values' instantly highlights any value that appears more than once in the selected range, which is one of the fastest ways to identify duplicates in a list. A 'Date Occurring' rule highlights dates falling in predefined periods — yesterday, today, tomorrow, last week, this month, and other common ranges — without needing to write any date formula. This is useful in project tracking and scheduling tools where you want visual indicators for recent or upcoming dates without any manual intervention or formula work.
Top/Bottom Rules highlight cells based on their relative position in the dataset rather than a fixed threshold. 'Top 10 Items' highlights the 10 highest values (you can change the number). 'Top 10%' highlights the top 10 percent of values. 'Bottom 10 Items' and 'Bottom 10%' work in the opposite direction. 'Above Average' and 'Below Average' highlight cells that fall above or below the mathematical average of the selected range. These are particularly useful in performance comparisons where you don't know the exact threshold in advance — you want to see what's above or below the group average.
Data Bars add a horizontal bar inside each cell proportional to the cell's value relative to the range. The highest value gets the longest bar, the lowest gets the shortest. This creates a built-in histogram effect that makes it easy to compare values visually across rows. You can choose solid or gradient fill, and you can customise the bar colour and direction. Data bars are effective for financial data, scores, and any column where relative magnitude matters more than absolute values.
Color Scales apply a gradient across the range — typically green for the highest values, red for the lowest, and yellow in the middle (though you can customize the colours). This creates a heat map effect where patterns in the data become immediately visible. Color scales work best with large datasets where individual values would take too long to scan manually. They're widely used in financial reports, scientific data analysis, and project management dashboards.
Icon Sets display small icons (arrows, traffic lights, flags, stars, or rating bars) inside cells based on value thresholds. A green upward arrow might indicate values in the top third, yellow sideways arrows for the middle, and red downward arrows for the bottom. Icon sets are useful for dashboards and summary reports where you want to communicate status at a glance without the reader needing to interpret specific numbers.
Custom Formula-Based Conditional Formatting
When the built-in rules don't fit your scenario, you can create a custom rule using a formula. Go to Conditional Formatting → New Rule → 'Use a formula to determine which cells to format.' Enter any Excel formula that returns TRUE or FALSE. Cells where the formula evaluates to TRUE receive the formatting you specify. The formula is evaluated relative to the first cell in your selected range — use relative references so the formula adjusts for each row. This is the most powerful conditional formatting option but requires understanding how references work in the rule context.
A common custom rule: format a cell based on the value in a different column. For example, highlight the entire row when column D equals 'Overdue': select your data range, create a new rule with the formula =$D1='Overdue' (using $ to lock the column but not the row). Every row where column D says 'Overdue' gets the formatting. The dollar sign before D is critical — without it, the column reference shifts for each column in the range, checking the wrong cell.
Use AND() or OR() in your formula for multi-condition rules. For example, =AND($C1>100,$D1='Active') highlights rows where column C exceeds 100 AND column D says 'Active'. Replace AND with OR to highlight rows meeting either condition. You can nest AND and OR for complex logic: =OR(AND($C1>100,$D1='Active'),$E1='Priority') highlights rows that are either active with value over 100 OR marked as priority.
Date-based rules are common in project tracking. To highlight cells containing dates that have passed (overdue items): =$A1<TODAY(). To highlight dates within the next 7 days: =AND($A1>=TODAY(),$A1<=TODAY()+7). For cells where a date is more than 30 days ago: =$A1<TODAY()-30. These formulas reference the TODAY() function, which updates automatically — so the conditional formatting adjusts as dates pass without any manual intervention.
Managing and Troubleshooting Conditional Formatting
As you add conditional formatting rules, managing them becomes important — especially when multiple rules apply to the same range.
- Manage Rules dialog: Home → Conditional Formatting → Manage Rules. This shows all rules for the current selection or the entire sheet. You can edit, delete, reorder, and change the priority of rules.
- Rule priority: When multiple rules apply to the same cell, rules higher in the list are evaluated first. Check 'Stop If True' on a rule to prevent lower-priority rules from applying if the current rule matches.
- Editing the range: Each rule shows its 'Applies to' range — you can modify this directly in the Manage Rules dialog without recreating the rule.
- Clearing all formatting: Home → Conditional Formatting → Clear Rules → Clear Rules from Selected Cells (or Entire Sheet) removes all conditional formatting without affecting other cell formatting.

Practical Examples of Conditional Formatting
Understanding how conditional formatting works in real scenarios makes it much easier to apply. Here are several examples that cover the most common use cases.
For a sales performance dashboard, apply a colour scale to a column of monthly sales figures. Select the sales column, go to Conditional Formatting → Color Scales, and choose the Green-Yellow-Red scale. The highest sales figures turn green, the lowest turn red, and middle values shade into yellow. At a glance, you can see which months performed best and which underperformed without reading individual numbers.
For an expense tracking spreadsheet, highlight any expense over £500 in red. Select the expense column, go to Conditional Formatting → Highlight Cells Rules → Greater Than, enter 500, and choose Red Fill. Every expense exceeding the threshold is immediately flagged. You can add a second rule for expenses over £1,000 using a darker red, giving you two tiers of visual priority.
For a project tracker with deadlines, highlight overdue tasks. Select the deadline column, go to Conditional Formatting → New Rule → Use a formula, and enter =A1
For duplicate detection in a customer list, select the column containing customer names or IDs. Go to Conditional Formatting → Highlight Cells Rules → Duplicate Values. Excel instantly highlights every value that appears more than once. This is one of the fastest ways to find duplicates in a dataset — far quicker than manually scanning or writing a COUNTIF formula, and the formatting updates in real time as you add or modify entries.
For grade tracking or performance reviews, combining a color scale with icon sets creates a powerful visual summary. Apply a green-red color scale to the scores column to show relative performance across the group, then add an icon set rule that displays a checkmark for passing grades and an X for failing grades. The two layers of formatting — subtle colour for relative context and clear icons for categorical status — give readers both comparative and absolute information simultaneously without requiring separate columns or charts.
Conditional Formatting Best Practices
- ✓Apply conditional formatting to the smallest range that's actually needed — formatting an entire column (A:A) instead of just the data range (A2:A500) wastes processing resources and can slow down large workbooks
- ✓Use relative references in custom formula rules so the formula adjusts for each row — lock column references with $ when the condition depends on a specific column (e.g. =$D1='Overdue')
- ✓Limit the number of rules per range to what's genuinely necessary — each additional rule adds evaluation overhead on every worksheet recalculation
- ✓Use 'Stop If True' in the Manage Rules dialog when you want to prevent lower-priority rules from applying once a higher-priority rule matches a cell
- ✓Choose colour combinations that remain distinguishable for colourblind users — avoid relying solely on red/green distinctions; use red/blue or add icons alongside colour
- ✓Test custom formula rules on a small sample before applying to a large range — incorrect absolute/relative references are the most common source of formatting errors
- ✓Review rules periodically with Manage Rules — copied and pasted cells can duplicate or extend formatting rules in unexpected ways over time
Conditional Formatting: Advantages and Limitations
- +Makes patterns and outliers in data immediately visible — colour, data bars, and icons communicate relative values much faster than reading individual numbers
- +Updates dynamically as data changes — when a value crosses a threshold or a date passes, the formatting adjusts automatically without manual intervention
- +No formula knowledge required for built-in rules — Highlight Cells, Top/Bottom, Data Bars, Color Scales, and Icon Sets are all point-and-click
- +Custom formula rules offer unlimited flexibility — any Excel formula that returns TRUE or FALSE can drive conditional formatting, enabling extremely specific conditions
- −Heavy use of conditional formatting on large ranges can noticeably slow down workbook performance — each rule is re-evaluated on every recalculation across every cell in the range
- −Rules can conflict or produce unexpected results when multiple rules apply to the same range — managing rule priority requires understanding the Manage Rules dialog
- −Copying and pasting cells that have conditional formatting can unintentionally extend or duplicate rules, creating formatting artefacts that are hard to trace
- −Conditional formatting doesn't print as clearly as it displays on screen — colour distinctions that are obvious on a colour monitor may be indistinguishable in a black-and-white print or PDF

Advanced Conditional Formatting Techniques
Beyond the standard built-in rules, several advanced techniques unlock more sophisticated formatting scenarios.
Formatting an entire row based on a single cell's value is one of the most requested advanced techniques. To highlight an entire row when column D contains the word 'Complete,' select the full data range (not just column D), create a new formula-based rule with =$D1='Complete', and set the format. The $ before D locks the column, so Excel always checks column D regardless of which column in the row is being evaluated. The row reference (1, in this case) is relative, so it adjusts for each row.
Alternating row colours (zebra striping) can be done through conditional formatting instead of Table formatting. Select your data range, create a new formula-based rule with =MOD(ROW(),2)=0, and set the fill colour. This formula uses MOD to check whether the row number is even — even rows get the formatting, creating alternating stripes. This approach is useful when you don't want to convert your range to a Table but still want the visual benefit of alternating colours.
Cascading rules — multiple rules on the same range that create different formatting tiers — are powerful for creating dashboards. For example, you might apply three rules to a performance column: green fill for values above 90, yellow for values between 70 and 90, and red for values below 70. Create all three rules, then arrange them in Manage Rules so the most specific rule (above 90) is evaluated first with 'Stop If True' checked, preventing the broader rules from overriding it.
Cross-sheet conditional formatting is possible but limited. You can reference cells on other sheets in your formula-based rules (e.g. =A1>Sheet2!$B$1), but the Manage Rules dialog only shows rules for the active sheet. This technique works for comparing values against a reference table on another sheet — for instance, highlighting any price that exceeds the maximum price listed on a reference sheet — but it's not supported for Data Bars, Color Scales, or Icon Sets, which only evaluate values within their own range.
Conditional Formatting in Excel: Quick Numbers
Performance Considerations for Large Workbooks
Conditional formatting is evaluated on every worksheet recalculation — every time you enter data, press F9, or open the workbook. For small datasets (a few hundred rows with a handful of rules), this is imperceptible. But for large workbooks with thousands of rows and many conditional formatting rules, the cumulative evaluation time can noticeably slow down the spreadsheet.
The most common performance issue comes from rules applied to entire columns (A:A) rather than specific data ranges (A2:A500). An entire-column rule evaluates over a million cells on every recalculation, even though most are empty. Always scope your conditional formatting to the actual data range — use the last row of your data as the end of the range rather than leaving it open-ended.
Another performance consideration is the number of distinct rules. Ten different conditional formatting rules on the same range means ten separate evaluations per cell per recalculation. If the range has 5,000 rows, that's 50,000 evaluations — still usually fast, but in workbooks with multiple sheets all formatted heavily, this adds up. Consolidating rules where possible (using a single formula with OR logic instead of two separate rules) reduces evaluation overhead.
Formula-based rules that reference volatile functions — like TODAY(), NOW(), INDIRECT(), or OFFSET() — force recalculation even when no data has changed, because Excel can't tell whether the result would be different without recalculating. This is usually fine for one or two rules but becomes a problem when combined with large ranges. If performance becomes an issue, consider replacing the conditional formatting with VBA macro-based formatting that only runs on command rather than on every recalculation.
One underused optimisation is using named ranges as your conditional formatting target. If your data grows or shrinks regularly, a dynamic named range (using OFFSET or a Table reference) ensures the conditional formatting only applies to cells that actually contain data. This is more efficient than applying rules to a fixed large range that includes many empty rows. Combined with avoiding volatile functions in your rule formulas, scoping rules to dynamic named ranges is one of the most effective ways to keep a heavily formatted workbook responsive.
One of the most common sources of unexpected conditional formatting behaviour is copy-paste. When you copy cells that have conditional formatting and paste them into a new location, Excel may create duplicate rules with overlapping ranges — or extend the original rule's range to include the paste destination. Over time, this can result in dozens of redundant rules applied to the same range, slowing down the workbook and making it hard to manage formatting. After pasting, open Home → Conditional Formatting → Manage Rules and review the rules for the active sheet. Delete any duplicate or unintended rules. Make it a habit to check Manage Rules periodically in workbooks where you frequently copy and paste formatted data.
Removing and Resetting Conditional Formatting
Clearing conditional formatting is straightforward: go to Home → Conditional Formatting → Clear Rules. You can choose to clear rules from the selected cells only or from the entire sheet. Clearing rules removes the conditional formatting but leaves all other cell formatting (manual colours, borders, number formats) intact. This is important to understand — clearing conditional formatting doesn't reset the cell to its completely unformatted state; it only removes the rules-based formatting layer.
If you need to reset a range to completely unformatted state — removing both conditional formatting and any manual formatting — select the range, go to Home → Clear (in the Editing group) → Clear Formats. This removes everything: conditional formatting, cell colours, fonts, borders, and number formats. It doesn't delete the data in the cells, only the formatting. This is useful when you've inherited a spreadsheet with heavy formatting that you want to strip back to a clean state for your own analysis or restructuring. The data itself remains completely untouched.
For targeted rule removal, Manage Rules gives you granular control. Open the Manage Rules dialog (Home → Conditional Formatting → Manage Rules), select the specific rule you want to remove, and click Delete Rule. This preserves all other rules and all manual formatting — you're removing only the specific conditional formatting rule you selected. This is the best approach when you want to adjust your formatting by removing one rule while keeping others active.
Conditional Formatting in Excel Questions and Answers
About the Author
Attorney & Bar Exam Preparation Specialist
Yale Law SchoolJames R. Hargrove is a practicing attorney and legal educator with a Juris Doctor from Yale Law School and an LLM in Constitutional Law. With over a decade of experience coaching bar exam candidates across multiple jurisdictions, he specializes in MBE strategy, state-specific essay preparation, and multistate performance test techniques.