Highlight cells with conditional formatting
Conditional formatting10 min
Builds on Make headers and totals stand out.
An accounts assistant at a print shop in Denver goes through 60 open invoices every Monday. Only a few need her, such as the large ones and any invoice entered twice. Conditional formatting colors those cells for her, and the colors keep up as invoices are paid and added.
How it works
A conditional formatting rule has two parts, a test and a format. Excel runs the test on each cell the rule covers, one cell at a time, and formats the cells that pass. When a value changes, Excel runs the test again, so a cell gains or loses its color by itself. Only the look changes: values, totals and sorting stay as they were.
Select the cells, then choose Home > Conditional Formatting. The ready-made rules sit in two menus. Highlight Cells Rules compares each cell with something you give it, and Top/Bottom Rules ranks the cells against each other:
| Row | A | B |
|---|---|---|
| 1 | Rule | Colors the cells that |
| 2 | Greater Than, Less Than, Between, Equal To | compare with a value you type, or with a cell such as =$F$1 |
| 3 | Text that Contains | hold a word, or part of one |
| 4 | A Date Occurring | fall yesterday, today, this week, last month and so on |
| 5 | Duplicate Values | appear more than once in the range |
| 6 | Top 10 Items, Bottom 10 Items, Top 10%, Bottom 10% | rank among the highest or lowest, for any number you set |
| 7 | Above Average, Below Average | are above or below the average of the range |
Each rule opens a small dialog for the value and the format. Any format works, as long as the people who read the sheet know what it means.
Example
A catering company in Chicago needs a manager to sign off any quote over $4,000. Select the quotes in B2:B6, choose Highlight Cells Rules > Greater Than, type 4000 and click OK, and the quotes of $6,200 and $4,850 turn red. Start the selection at B1, on the heading, and the heading turns red as well:
Common mistakes
- Selecting the heading with the numbers. Greater Than then colors the heading, because text counts as larger than any number. Select the data cells only.
- Greater Than 4000 leaves out a quote of exactly $4,000. For "4,000 or more", choose More Rules at the bottom of Highlight Cells Rules and pick greater than or equal to.
- Top 10 Items colors ten cells until you change the 10 in its dialog.
- Duplicate Values colors every copy, the first one included. It only marks them: nothing is deleted.
In short
- A rule is a test and a format. Excel tests every cell in the range, and tests again whenever a value changes.
- Highlight Cells Rules compare each cell with a value, a word or a date. Top/Bottom Rules rank the cells.
- Select only the data, and decide whether the limit itself should be colored.
Practice
5 exercises · free, no account needed
- Not started
1. Color the invoices over $2,500
Conditional formatting · easy
- Not started
2. Find every manager in a staff list
Conditional formatting · easy
- Not started
3. Color the three biggest deals
Conditional formatting · medium
- Not started
4. Find the invoice entered twice
Conditional formatting · medium
- Not started
5. When an amount changes
Quiz · easy