Sub topic 14
Troubleshooting common problems
This chapter assumes you can write formula-based rules, understand relative, absolute and mixed references, and can open the Conditional Formatting Rules Manager. When a rule misbehaves, the cause is almost always one of a few things: the reference, the Applies to range, the rule order, or the data itself.
A method for finding the cause
Work through these checks in order. Each one is quick, and most problems end at the first or second.
- Open Home > Conditional Formatting > Manage Rules.
- Set Show formatting rules for to This Worksheet so you see every rule, not only those on the selection.
- Read the Applies to range and the formula for the rule that should be firing.
- Check whether a rule above it takes priority.
- Test the formula in a spare cell and see whether it returns TRUE or FALSE.
Wrong references
The most common fault is a formula written relative to the wrong cell. Excel evaluates the formula as if it were typed in the top-left cell of the Applies to range. If the range is $A$2:$E$50 and your formula says =$C5>1000, every cell is compared with a row offset by three, so the highlighting looks shifted.
The second fault is a missing dollar sign. Take =C2>1000 applied to A2:E50. Column A checks column A, column B checks column B, and so on, so only some cells in the row highlight. Locking the column fixes it.
=$C2>1000The third fault is a counting range that is not fixed. =COUNTIF(A2:A100,A2)>1 moves its range down as it is evaluated for each row, so duplicates above the current row are missed. Fix the range:
=COUNTIF($A$2:$A$100,$A2)>1Overlapping rules and order
If two rules set the same property, such as fill color, the rule higher in the list wins. Rules that set different properties, such as one fill and one bold font, both apply. When a highlight is missing, look for a higher rule whose condition is also true.
- Move the rule you want to win upward with the arrow buttons.
- Select Stop If True on a rule to prevent lower rules from applying to a cell where it is true.
- Delete rules left over from copying and pasting. Pasting cells often splits one rule into many fragments with small Applies to ranges.
Data that looks right but is not
A rule can be correct while the data is not what it seems.
| Symptom | Likely cause | Fix |
|---|---|---|
| `>1000` never fires on numbers that look correct | Numbers stored as text, often left-aligned | Convert with **Text to Columns** or multiply by 1 |
| Date rule highlights nothing | Dates stored as text | Re-enter or convert them to real dates |
| `=$C2=""` flags cells that look filled | Cell holds a space or a formula returning `""` | Use `=TRIM($C2)=""` or clean the data |
| Duplicates not detected | Trailing spaces or different capitalization of invisible characters | Apply `TRIM` to the data |
| Rule stops working after inserting rows | Range split or not extended | Edit **Applies to** in the Rules Manager |
Other limits to remember
- Conditional formatting formulas cannot refer to other workbooks in older Excel versions. Current versions allow it only while the other workbook is open.
- Rules react to changes in value, not to the passage of time alone.
TODAY()updates when the workbook recalculates or reopens. - Manual fill is overridden by a conditional format. If a cell has a fill you cannot remove, check for a rule before clearing the formatting.
- Full-row rules need the column locked and the row relative, as in
=AND($B2<>"",$C2="").
Exercise
A rule =B2>100 is applied to A2:D20 to highlight whole rows where column B exceeds 100. Only column B cells highlight. What is wrong, and what is the corrected formula?
Show answer
The column reference is relative, so column A checks A2, column C checks C2, and so on. Lock the column with a dollar sign: =$B2>100.
Exercise
Your overdue rule =$D2<TODAY() is correct and applied to the right range, but a red fill from another rule still shows on those rows. Where do you look, and what are two ways to fix it?
Show answer
Open the Rules Manager and look for a rule listed above the overdue rule that sets the fill and is also true. Move the overdue rule above it, or select Stop If True on the overdue rule so lower rules do not apply.