keepcalculator

06 Numbers and Powers

Cool Conditional Formatting Tricks in Excel

Card No. 06·48990 · Updated · Standard formula, shown below

Above pass mark 15 points
Score
75 points
You entered
Pass mark
60 points
You entered
You enter
Score, Pass mark
You get
Above pass mark
Rounding
0 dp

Conditional formatting in Excel lets you automatically change a cell’s appearance based on its value or a formula, turning raw data into a visual dashboard. You can highlight duplicates, color-code entire rows, build in-cell data bars, and even create heat maps with just a few clicks. This guide walks through the most useful tricks, the logic behind them, and how to fix common problems.

Formula

The simple comparison above is a stand-in for the kind of logic conditional formatting uses. The formula is:

Above pass mark = score − pass mark

Where:

  • score = the student’s score in points (0–100)
  • pass mark = the minimum passing score in points (0–100)

The expression includes a guard that returns “Cannot compute” if the score is below the pass mark, which mirrors how conditional formatting rules evaluate to TRUE or FALSE.

Worked Example

Using the defaults: score = 75, pass mark = 60.

  1. Subtract the pass mark from the score: 75 − 60 = 15.
  2. The result is positive, so the student is above the pass mark.
  3. The calculator displays 15 points above the pass mark.

If the score were 45, the guard would trigger and show “Cannot compute” because the score is below the pass mark.

What Conditional Formatting Actually Does

Conditional formatting is a rule engine. You define a condition (for example, “cell value is greater than 100”) and an appearance (bold, red fill, icon). When the condition is TRUE, the formatting applies; when FALSE, it does not. The rules are re-evaluated every time the worksheet recalculates, so the formatting updates automatically as you edit data.

Excel offers five built-in rule types:

  • Highlight Cells Rules – greater than, less than, between, equal to, text that contains, dates occurring, duplicate values.
  • Top/Bottom Rules – top 10 items, bottom 10%, above average, below average.
  • Data Bars – a colored bar inside the cell proportional to the value.
  • Color Scales – a gradient across a range (e.g., green-yellow-red).
  • Icon Sets – arrows, traffic lights, or flags based on thresholds.

You can also write your own formula as the condition, which unlocks nearly unlimited possibilities.

Cool Tricks You Can Do Right Now

Here are the most practical tricks, with the exact steps for each.

1. Highlight Duplicates in a Column

  1. Select the range (e.g., A2:A100).
  2. Go to Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values.
  3. Choose a format and click OK.

This is the fastest way to spot repeated entries in a list of emails, order IDs, or names.

2. Color an Entire Row Based on One Cell

Suppose you want to highlight every row where the status column says “Overdue”.

  1. Select the entire data range (e.g., A2:F100).
  2. Click Conditional Formatting → New Rule → Use a formula to determine which cells to format.
  3. Enter: =$F2="Overdue" (assuming F is the status column).
  4. Set a fill color and click OK.

The dollar sign before the column letter locks the column, so the rule applies to the whole row. This is one of the most useful tricks for project trackers and inventory lists.

3. Build In-Cell Data Bars

  1. Select the numeric range.
  2. Click Conditional Formatting → Data Bars → choose a solid or gradient fill.

The bar length is proportional to the value relative to the other cells in the range. This turns a plain column of sales figures into an instant bar chart.

4. Create a Heat Map with Color Scales

  1. Select the range (e.g., a matrix of test scores).
  2. Click Conditional Formatting → Color Scales → pick a 3-color scale.

The lowest values get one color, the highest get another, and mid-values get the middle color. This is excellent for spotting outliers in large tables.

5. Use Icon Sets for Quick Status

  1. Select the range.
  2. Click Conditional Formatting → Icon Sets → choose arrows or traffic lights.

By default, icons split values into thirds. You can adjust the thresholds by clicking Manage Rules → Edit Rule.

6. Highlight Every Other Row (Zebra Stripes)

  1. Select the range.
  2. Use a formula rule with: =MOD(ROW(),2)=0
  3. Set a light fill.

The MOD function returns 0 for even rows, so only those rows get the fill. This is a clean alternative to Excel’s built-in table styles.

7. Find Cells That Are Blank

  1. Select the range.
  2. Use a formula rule with: =ISBLANK(A2)
  3. Pick a yellow fill.

This instantly shows missing entries in a data-entry sheet.

How to Choose the Right Rule

With so many options, the key is to match the rule to the question you’re asking:

  • Compare to a fixed number → Highlight Cells Rules (e.g., sales below $500).
  • Find the best or worst performers → Top/Bottom Rules (e.g., top 10% of students).
  • Show magnitude at a glance → Data Bars (e.g., revenue by region).
  • Show distribution across a range → Color Scales (e.g., temperature readings).
  • Apply formatting based on multiple conditions → Formula rule (e.g., overdue AND high priority).

If you need a condition that involves two columns (like “show rows where quantity is greater than reorder level”), a formula rule is almost always the answer.

Common Mistakes and How to Fix Them

Conditional formatting is powerful but easy to get wrong. Here are the most frequent pitfalls:

  • Wrong cell references in formulas. When using a formula rule, the reference must be relative to the active cell. If your rule works for the first row but not the rest, check the dollar signs. Use $A2 for a fixed column, A$2 for a fixed row, and A2 for fully relative.
  • Rules not applying to new data. Conditional formatting only covers the range you selected. If you add rows below, they won’t get the formatting. Use an Excel Table (Insert → Table) so new rows automatically inherit the formatting.
  • Too many rules slowing the sheet. Each rule is evaluated for every cell in its range. Hundreds of rules across large ranges can make Excel sluggish. Consolidate rules where possible and limit ranges to the actual data area.
  • Formatting disappears when you copy cells. Copying a cell with conditional formatting copies the rule, not just the format. If you want to copy only the fill color, use Paste Special → Formats. To remove rules entirely, select the range and go to Conditional Formatting → Clear Rules.
  • Using “less than” when you mean “less than or equal to”. The built-in rules have separate options. Double-check the dialog before applying.

Using Formulas for Advanced Conditions

Formula-based rules are the most flexible. Here are a few real-world examples:

  • Highlight rows where a date is within the last 7 days: =A2>=TODAY()-7
  • Highlight cells that contain a specific text (case-insensitive): =ISNUMBER(SEARCH("urgent",A2))
  • Highlight the maximum value in a column: =A2=MAX($A$2:$A$100)
  • Highlight rows where both conditions are true: =AND($A2="Open",$B2>TODAY())

Remember: the formula must return TRUE or FALSE. Any formula that evaluates to a number also works (0 is FALSE, any non-zero is TRUE).

Performance and Best Practices

Conditional formatting is recalculated whenever the sheet changes. For large datasets (tens of thousands of rows), keep these tips in mind:

  • Apply formatting to the exact range, not entire columns (e.g., A2:A1000 instead of A:A).
  • Use built-in rules when possible; they are optimized better than custom formulas.
  • Avoid volatile functions like TODAY() or NOW() in thousands of rules – they force recalculation every time the sheet changes.
  • If you have many rules, consider using a helper column that computes a status (e.g., “Overdue”) and then apply a simple cell-value rule to that column.

Frequently Asked Questions

Why is my conditional formatting not working?

Most often it’s a reference error. Check that the formula uses the correct relative/absolute references for the active cell. Also verify the rule range includes the cells you expect, and that the condition actually evaluates to TRUE for some cells. Use the “Evaluate Formula” tool or test the formula in a worksheet cell first.

Can I copy conditional formatting to another sheet?

Yes. Select the formatted range, press Ctrl+C, go to the target sheet, right-click the top-left cell of the destination, and choose Paste Special → Formats. This copies the rules and their ranges. If the ranges are different, adjust them via Manage Rules.

How do I delete only the conditional formatting, not the cell values?

Select the range, go to Home → Conditional Formatting → Clear Rules → Clear Rules from Selected Cells. This removes all rules from that range without touching the data.

Can I use conditional formatting to change the font color based on a cell value?

Yes. In the rule dialog, click the “Format” button and go to the Font tab. You can set font color, bold, italic, and underline. This is useful for highlighting negative numbers in red or making top performers bold.

Does conditional formatting work in Google Sheets?

Yes, Google Sheets has a similar feature under Format → Conditional Formatting. The interface differs slightly, but the core concepts (rules, formulas, ranges) are the same. Many of the tricks here translate directly, though the formula syntax is the same for basic comparisons.

Why do my data bars show the same length for different values?

Data bars scale relative to the minimum and maximum of the selected range. If all values are close together, the bars look similar. You can change the minimum and maximum to fixed numbers by editing the rule and setting “Minimum” and “Maximum” to Number instead of Automatic.

Related

Formula used
in score | Score | points | 75 | 0 | 100
in pass | Pass mark | points | 60 | 0 | 100
out above | Above pass mark | points | score - pass + 0 * sqrt(max(0, pass - score)) | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →