Sub topic 1
What Conditional Formatting Does and Where to Find It
Prerequisites
This chapter assumes you can do the following:
- Enter and edit data in worksheet cells.
- Apply basic formatting such as fill and font color.
- Write simple formulas such as
=A1+B1. - Select cell ranges with the mouse or keyboard.
What conditional formatting does
Conditional formatting changes how a cell looks based on its value or on a formula. You don't color cells by hand. You write a rule, and Excel applies the formatting to every cell that meets it.
Three properties of this feature shape everything else in the tutorial:
- It is live. Excel re-evaluates each rule whenever the data changes. If a value drops below a threshold, the highlight disappears without any action from you.
- It is separate from the cell's own format. The rule sits on top of the fill and font you set manually. The cell's value and its normal formatting stay unchanged. Clearing the rule restores the original look.
- It is based on a rule. Every rule has three parts: the cells it covers, a condition, and the format to apply when the condition is true.
Where to find it
Select the cells you want to format first. Then open the Home tab and find the Styles group. Click Conditional Formatting.
The menu has these entries:
| Menu entry | What it does |
|---|---|
| Highlight Cells Rules | Compares values, matches text, finds duplicates and dates |
| Top/Bottom Rules | Marks the top or bottom N items or percent, or values above or below average |
| Data Bars | Draws a bar in each cell sized to its value |
| Color Scales | Shades cells on a gradient from low to high |
| Icon Sets | Adds icons that classify values into groups |
| New Rule | Opens the full rule dialog, including formula-based rules |
| Clear Rules | Removes rules from the selection or the whole sheet |
| Manage Rules | Opens the Rules Manager to review, edit and reorder rules |
The first five entries are built-in rule types. The later chapters cover each one. New Rule and Manage Rules give you full control, and you will use them once the built-in options are not enough.
Creating your first rule
Suppose column C holds order totals in C2:C50, and you want totals over 1000 highlighted.
- Select C2:C50.
- Choose Home > Conditional Formatting > Highlight Cells Rules > Greater Than.
- Type
1000in the box. - Pick a format from the drop-down, such as Light Red Fill with Dark Red Text.
- Click OK.
Every total above 1000 now has the red format. Change a total from 900 to 1200 and its cell turns red at once.
Later you will write rules as formulas. A formula rule for the same goal, applied to whole rows, looks like this:
=$C2>1000You don't need to understand the $ yet. Chapters on formula rules and references explain it.
Common first mistakes
- Selecting the wrong cells. If you select only one cell, only that cell gets the rule. Select the full range, such as C2:C50.
- Including the header row. A header such as "Total" is text. Excel treats text as greater than any number in some comparisons, so a "greater than" rule can highlight your header. Start the selection below the header.
- Coloring cells by hand and expecting updates. A manual fill is static. It does not respond to data changes. Use a rule when the color must follow the data.
- Stacking rules without noticing. Several rules can cover the same cells. Open Manage Rules to see all of them.
Exercise
You select A1:A20, where A1 is a header, and apply a Greater Than 100 rule. What should you change, and where would you check which rules are active on the sheet?
Show answer
Reselect A2:A20 so the header is excluded, then check active rules with Home > Conditional Formatting > Manage Rules, set to show rules for This Worksheet.