Part of our Productivity Tools guides
Excel conditional formatting automatically changes a cell’s appearance when its value or a formula meets a rule, helping you spot exceptions and patterns faster. These excel conditional formatting examples help busy professionals improve spreadsheet clarity and speed up data review. The feature can flag key values, reveal patterns, and call attention to data issues as values change.
A conditional formatting rule is an instruction that applies a chosen format when selected cells meet a condition. Copy-ready examples can help with common work tasks, but not every rule fits every sheet. Choose a clear visual cue that makes the business decision easier, not a color that simply decorates the sheet.
Key Takeaways
- Use a built-in rule when its condition matches the choice you need to make.
- Use formulas when your rule needs custom logic or must compare cells.
- Apply rules only to the data cells that need a visual signal.
- Check rule order when more than one rule affects the same cell.
- Test a new rule on a small range before using it across a report.
- Choose colors and icons that remain easy to read and explain.
Set Up a Conditional Formatting Rule
A conditional formatting rule tells Excel which cells to watch and what appearance to apply when its condition is met. The selected range determines which cells can change, so choose it with care.
Start by selecting the cells you want the formatting rule to cover. Conditional formatting can apply to a cell range or an Excel table. In Excel for Windows, it can also apply to a PivotTable report.
Select the cells the rule should cover
Use your mouse to select the cells you want to format. A range may include one column, several columns, or a full set of data rows.
Excel tables can help keep a rule with the table as its data grows. The Quick Analysis button may appear beside selected data, but the Home tab also holds the full set of rule tools.
Choose a built-in rule or create a new one
- Select the target cells in the worksheet.
- Open Home > Conditional Formatting.
- Choose a preset rule or select New Rule.
- Set the condition and choose a format.
- Save the rule and check the result in the worksheet.
Preset rules work well when you want to compare values, find repeats, or show a range of results. New Rule gives you more choices, including formula-based formatting. Select a fill or font style that keeps the value easy to read.
PivotTable rules include extra choices for setting their scope. Their formatting stays tied to the underlying fields when the PivotTable layout changes. Before saving, confirm that the selected range excludes headers unless you intend to format them too.
Choose a Built-In Rule for a Fast Visual Scan
For a quick scan, start with a built-in rule when its condition already matches the decision you need to make. These ready-made options can highlight cells without a custom formula.
Match the rule type to the data and the question you need answered. Numeric selections can show value-based rules, while text selections can offer text and duplicate checks.
Use Quick Analysis for a quick preview
Select your data, then press Ctrl+Q to open Quick Analysis. Its options depend on what you selected, so a number range and a text list may show different choices.
Numeric selections can offer Data Bars, Colors, Icon Sets, Greater, and Top 10%. Text selections can offer Text, Duplicate, Unique, and Equal To. This preview helps you see which built-in tools fit the selected cells.
Match the rule type to the data
| Option | Best for | What Excel highlights | Example use |
|---|---|---|---|
| Greater | Values above a cutoff | Cells above 100 | Sales over a target |
| Duplicate | Repeated entries | Each repeated email | Finding duplicate contacts |
| Data Bars | Comparing amounts | Longer bars for larger values | Comparing monthly sales |
| Color Scales | Showing value patterns | Different shades for low and high cells | Scanning test scores |
For example, Greater can highlight cells above 100, while Duplicate marks repeated email addresses. A bar or shade shows relative value without making you read each number first.
Quick Analysis previews options for the current selection, not every option Excel offers. A range of numbers can show numeric tools, while text can reveal text-related tools. Preview the result on a small range first if the color could hide text or make the sheet harder to read.
Find the Highest and Lowest Values
Top/Bottom rules quickly mark the highest or lowest values in a selected range without a custom formula. Choose Items to set a count, or Percent to mark a share of the cells.
Top 10 Items starts with ten values, while Top 10% starts with ten percent of the range. Change either default to match the group you need to review.
Select Top 10 Items or Bottom 10 Items to focus on individual results. The item rule accepts any whole number up to 1000. You can use it to mark the five largest orders or the 25 lowest scores.
The Top 10% and Bottom 10% rules use a share instead of a fixed count. Their percentage can be changed to any whole number up to 100. That can help when the data range grows or shrinks over time.
Items and percentages can produce different results. A 10% rule applied to 30 cells highlights three cells because Excel rounds the count down. An item rule counts values directly, so selecting ten means ten values when there are no ties.
Top/Bottom Items includes all tied values, so the number highlighted can exceed the selected count. If two values tie around the cutoff, both may receive the format. This is not a rule failure; Excel includes each tied value.
Use the rules to bring strong and weak results into view, then inspect the values that drove the result. A small data set can make a percentage group very small, while ties can make an item group larger. Check the whole-number limits for Top/Bottom rules when setting a custom count. Check the actual highlighted cells when ties or a small percentage group could change the count you expect.
Excel Conditional Formatting Examples for Everyday Work
A sales list becomes easier to act on when high spend and mid-range spend use different, clear colors. The right rule depends on the question behind each group.
Built-in rules can flag values, text, dates, and duplicate entries without a formula. Use a separate condition for each work need.
Flag values above a target or between two limits
Use Greater Than to highlight customer spend above $10,000. That figure is an example, not a universal sales target. Enter the threshold that fits your team’s goals.
Use Between to flag spend from $5,000 to $9,999. This range can mark a middle group for review. A different range may suit your business or report.
| Work need | Rule | Condition to enter | What gets highlighted |
|---|---|---|---|
| Spend above a target | Greater Than | More than $10,000 | Customers spending over $10,000 |
| Spend between limits | Between | $5,000 to $9,999 | Customers in that spend range |
| Repeated text or values | Duplicate Values | Repeated email or order number | Each repeated value in the range |
Mark text, dates, and duplicates
Text that Contains can find a word such as “late” in a status column. Date Occurring can highlight calendar periods such as today or last week. Duplicate Values can mark repeated names, email addresses, or order numbers.
These presets look at the cells you selected. Select only the status column to mark matching words there, or choose a wider range when repeated values across several fields matter.
Preset colors may not fit your workbook’s design. Open the formatting choices and pick a custom fill or font color with enough contrast. Keep the text readable on screen and in print.
Use one color for each business meaning, not just each rule. A darker shade might mark a high spend group, while a lighter shade marks a review band. Keep threshold bands separate so one customer does not appear to qualify for two colors by accident.
Create a Formula-Based Rule for Custom Logic
A formula-based rule is useful when a preset cannot express the condition you need. It lets a formula decide whether Excel applies formatting to selected cells.
The formula must begin with an equal sign and return TRUE or FALSE, or a number that acts like TRUE or FALSE. Excel uses that result to trigger the format.
Write a formula that returns TRUE or FALSE
- Select the target range you want to format.
- Choose Home > Conditional Formatting > New Rule.
- Select the formula option for the rule.
- Enter the formula, set the format, and save.
References in the formula should match the upper-left cell of the selected range. Excel uses that starting point as it evaluates the rest of the range. A reference that starts on the wrong row can shift the result.
For example, select a text range beginning at A2 and write a formula using A2. Excel then checks the matching cell as it applies the rule through the range. A TRUE result applies the chosen appearance; FALSE leaves the cell unchanged.
Combine text checks with OR
To format cells containing apple, kiwi, or lime, use =OR(A2="apple",A2="kiwi",A2="lime"). This one rule can replace three separate text rules.
The OR function returns TRUE when at least one listed test matches. In this example, Excel checks the value in A2 against each fruit name. Use the column and first row that match your selected range.
Formula basics can also help when you build rules with IF, AND, or OR. A beginner guide to spreadsheet formulas covers those common tests and cell references.
If a formula rule fails, enter the same formula in a worksheet cell that matches the range’s first cell. That lets you see whether the result is TRUE or FALSE. Test the formula in a worksheet cell if the rule does not trigger as expected.
Highlight an Entire Row When One Cell Meets a Condition
A full-row highlight can make the customer name and spend figure easy to scan together. Use a formula that checks one column, then apply its format across each data row.
For data starting on row 2, =$F2>10000 highlights rows with spend above 10,000 in column F. Select the full data rows, but leave out the header.
The dollar sign fixes the formula’s column at F. The row number stays flexible, so Excel checks F2, F3, F4, and each later row as it applies the rule.
To set it up, select the full range of data rows. Create a New Rule, choose the formula option, and enter the example formula. Then choose the fill or font format that should appear across the row.
The formula checks only the spend value in column F. When that value is greater than 10,000, Excel applies the chosen format to every selected cell in that row. This is a direct way to use an Excel conditional formatting formula with IF greater than logic, without adding an IF function.
For example, a range from A2 through H50 can show the customer name, date, and spend together. The formula still checks column F for each row. Keep the first formula row aligned with the first data row in the selected range.
Combine Multiple Conditions in One Rule
Use AND when every test must pass, and use OR when any one test is enough to apply the format. The choice of function should match the decision you need the sheet to show.
AND requires all listed conditions to be true; OR needs only one true condition. Both functions work inside a formula-based conditional formatting rule.
Require every condition with AND
The formula =AND(K6<=1638,L6=0) checks two conditions. It returns TRUE only when K6 is at most 1638 and L6 equals zero.
Use this kind of rule when a record needs to meet both limits. For example, you might format a row only when its score stays below a set point and its status field remains zero.
For several checks, add each TRUE/FALSE test and compare the sum with the number of required matches. If seven tests must all pass, add the seven results and check whether their sum equals seven.
Match any condition with OR or use an IF alternative
Use OR when any one condition should trigger formatting. If either a due date has passed or a status says “late,” OR can return TRUE and apply the format.
IF formulas return a result after checking conditions, which is different from choosing a format. Excel allows up to 64 nested IF functions, but deeply nested formulas can be hard to build and maintain.
IFS can test several conditions in order. For example, =IFS(D2>89,"A",D2>79,"B",D2>69,"C",D2>59,"D",TRUE,"F") returns the first matching grade. The final TRUE provides a fallback when no earlier test matches.
For two conditions in a formatting rule, place both tests inside AND or OR. For three conditions, add a third test inside the same function. Decide whether all three must pass or any one should trigger the color. Choose the formula that matches the decision rule before adding more conditions.
Compare Cells with the Right References
A formula can be logically correct and still format the wrong cells if its references shift in the wrong direction. The starting point is the top-left cell in the Applies to range.
Write the formula for the top-left cell, then let relative references adjust through the range. A dollar sign fixes a column or row when needed.
- Relative reference: A1 can change by row and column.
- Mixed reference: $A1 fixes column A, but the row can change.
- Absolute reference: $A$1 fixes both column A and row 1.
Keep the compared columns fixed as a rule moves down
The formula =$A1>$B1 compares the values in columns A and B on the same row. The dollar signs fix both columns, while the row number changes as the rule moves down.
For a range that starts on row 1, the formula checks A1 against B1 first. It then compares A2 with B2, followed by the next row. If the range starts lower, use that first row number in the formula instead.
Lock a single comparison value
The formula =$A1>$B$1 compares each value in column A with the fixed value in B1. Column A stays fixed, the row in A can change, and both parts of B1 stay fixed.
This setup helps when every row must meet one shared target. For instance, each department score can be compared with a target stored in B1. The target does not move as Excel checks later rows.
Relative and absolute references also matter in regular worksheet formulas. The spreadsheet formula basics explain how references change as formulas move.
When the Applies to range starts at C4, write the formula as if Excel were testing C4 first. A reference that begins on row 1 may point to the wrong record. Check the first cell in the Applies to range against the first reference in the formula.
Show Value Patterns with Color Scales and Data Bars
Color Scales suit a quick view of distribution, while Data Bars make differences in size easy to compare. Each visual option shows a range in a different way.
A Color Scale shades cells by value, while a Data Bar uses bar length to show relative size. Both can help you scan a large number range.
Use color scales to compare low, middle, and high values
A Color Scale can shade lower values one color and higher values another. A three-color scale adds a middle shade for values between those ends. This makes broad patterns easier to see.
For positive and negative change values, set the midpoint to zero. A three-color scale can use red below zero, a neutral color at zero, and green above zero. The display then shows losses, no change, and gains.
This works well for changes in sales, budgets, or scores. A value below zero may need attention, while a value above zero may show growth. Choose the midpoint to match the question behind the data.
Use data bars to show relative size
Data Bars place a bar inside each cell. The bar’s length represents its value compared with other cells in the selected range. Longer bars show larger values.
For a range that includes negative numbers, Excel can place the axis in the middle. Negative bars extend left from that central axis, while positive bars extend right. This gives both sides of zero a clear visual path.
Choose Show Bar Only when the report works better without the cell value. This hides the number but leaves the bar. Readers can still compare the bars, though they cannot read exact values in those cells.
Bars work well for a compact report, while a scale can show how values spread across a range. Keep the cell size and bar display in mind when the sheet has many columns. Use a zero midpoint when the business question is whether each value is below, at, or above zero.
Use Icon Sets for Clear Status Signals
Icon Sets work well when you want a fast status cue that does not depend on reading every number. An icon group sorts values into visible levels.
Excel icons change when their cell values change. Arrows, stars, and flags can mark different levels in a range.
A three-triangle set can show green for the highest values, orange for middle values, and red for the lowest. This gives a quick view of which results need attention.
Icons can suit a status report where readers need to scan many rows. A flag might mark a goal, an arrow might show direction, and a star might mark a chosen level.
Icon Sets use value ranges to decide which symbol appears. As a cell value changes, Excel can assign a different icon. A record that moves from a middle value to a high value may switch from orange to green.
The symbol alone may not explain the business meaning. A red icon could mean low performance, a risk, or a missed target. Add a small legend whenever the icon meaning is not obvious to someone opening the sheet for the first time.
Flag Dates and Upcoming Deadlines
A date rule can keep near-term deadlines visible without asking you to rescan the whole schedule. Use a preset for a familiar calendar period or a formula for a moving window.
The Date Occurring preset can highlight periods such as today, yesterday, last week, and last month. Those choices suit common calendar checks.
Select the date cells and choose the period that matches your review. A today rule can draw attention to due dates on the current day. A last week rule can help you review recent events.
To highlight dates in the next 30 days, use =AND(B4>NOW(),B4<=NOW()+30) when the selected range starts at B4. The formula checks for a future date no more than 30 days away.
NOW returns the current date and time. As time passes, Excel updates the check, so the highlighted set can change. A date that once fell within the window may no longer qualify later.
The formula uses a strict greater-than check for NOW, so a date at the current time does not pass that test. Date cells need real Excel date values for the comparison to work. Decide whether a due-today item should count as upcoming before you set the boundary in the formula.
Fix Text, Date, and Reference Problems
If a rule does not fire, check the cell content and references before rebuilding it. Small data issues can change how Excel reads a value.
Trailing spaces, text-formatted dates, shifted references, and formula errors can all affect a rule. Check the cell and test the formula before changing the format.
Check for hidden spaces and text values
A cell may look correct but contain a trailing space. Exact-text rules can then miss the value. TRIM removes extra spaces from text, which can help clean a list before you apply a rule.
Date comparisons also need real numeric Excel dates. A date stored as text may look like a date, but Excel may not compare it as one. Convert text dates to numeric dates before relying on date rules.
| Symptom | Likely cause | Check | Fix |
|---|---|---|---|
| Exact text is missed | Trailing spaces | Compare cell text with the expected text | Clean the value with TRIM |
| Date rule misses a date | Date stored as text | Check whether Excel treats it as a number | Convert it to a numeric Excel date |
| Wrong row or cell changes | Reference shifted | Compare the first range cell with the formula | Adjust the reference for the range start |
| Rule does not format a cell | Formula returns an error | Test the formula in worksheet cells | Correct the error before applying the rule |
Test the formula and its references
Enter the rule’s formula in worksheet cells that match the applied range. This lets you see each result and find the row where the logic changes.
Formula errors do not receive conditional formatting in the affected cells. Check for broken references or values that the formula cannot use. A result that appears blank may still be an error.
Text cleanup can also help with other spreadsheet formulas. A guide to basic formulas and text cleanup explains how TRIM works with common functions. Confirm that the formula returns a usable result for every cell in the range.
Review Rule Order and Resolve Overlaps
When two rules affect the same cell, the displayed result depends on whether their formats conflict and which rule has higher precedence. Rule order matters when both tests are true.
Nonconflicting formats can appear together, but conflicting formats follow precedence. Manage Rules lets you review the order and the Applies to range.
Check which rule takes precedence
Imagine rules that format values greater than 99, greater than 100, and greater than 105. A value of 110 meets all three conditions. If the rules use different fills, their order affects the result.
Open Home > Conditional Formatting > Manage Rules to review the rules. Check which rule appears first and move rules when the higher-priority format should win. A font change and a fill change may both show when they do not conflict.
Inspect the Applies to range in Manage Rules
Manage Rules also shows the Applies to range for each rule. A rule aimed at the wrong cells may create a surprise even when its condition is right. Check the range alongside its priority.
- Confirm that the correct worksheet is selected.
- Check that the Applies to range covers the intended data.
- Review which rule has higher priority.
- Confirm that Stop If True is intentional for the rule.
Stop If True can prevent lower rules from applying when a higher rule matches. Use it only when that result fits the way you want the sheet to look.
After you change the order, test a cell that meets more than one condition. Its fill or font can reveal whether the priority now matches your intent. Recheck a cell that meets more than one condition after changing the rule order.
Edit, Copy, or Remove Existing Rules
You can update or remove an existing rule without rebuilding the rest of the worksheet. Use Manage Rules to change a rule, or copy formatting when another range needs the same look.
Removing conditional formatting does not change the underlying cell values. It changes how Excel displays those values.
- Edit an existing rule in Manage Rules.
- Duplicate or copy a rule where that option is available.
- Use Format Painter to apply formatting to another range.
- Use Clear Rules to remove rules from selected cells or a worksheet.
In Manage Rules, select the rule you want to edit or delete. You can change its condition, format, or Applies to range. Review the result in the worksheet after saving the change.
Format Painter can copy conditional formatting to another data range. This is useful when two sections need the same visual style. Copied formula rules may need adjusted cell references, since the new range can start on a different row or column.
Clear Rules can remove rules from selected cells or the whole worksheet. The cell values remain in place, even after their colors or icons disappear. After copying a formula rule, verify that its references still match the new range.
Keep Conditional Formatting Useful and Reliable
The right rule is the one that shows the needed signal without adding visual noise or unsupported formula logic. Keep the purpose clear for anyone who reads the sheet.
Use built-in rules for bars, scales, or icons, and formula rules for custom logic with standard cell formatting. Each type has limits.
Custom formula rules cannot create Icon Sets, Color Scales, or Data Bars. They also cannot reference another workbook. Choose a built-in visual rule when you need one of those displays.
Formula errors prevent formatting in the affected cells. A rule may work for most rows but fail where its formula returns an error. Keep formulas simple enough to check and maintain.
Keep the Applies to range focused on the data you need to scan. A rule that covers extra cells can add color where it does not help. A narrow range can make the key signal easier to find.
Think about the decision before choosing the format. A fill may suit an exception, while a bar can compare size. Match the rule type to the decision, then check the result on the full range.
Conclusion
A well-chosen rule turns a busy worksheet into a clearer view of the values that need attention. One clear signal can help you spot an overdue date, a missed target, or a result outside its expected range.
Start with a real decision you need to make, such as finding an overdue item or checking values beyond a target. Pick one format that makes that decision easy to see, then review whether the color or icon remains clear beside the cell data.
Apply one rule to a small copy of your data, check that it flags the right cells, and then use it in the working sheet.



