Sub topic 2
Showing Distribution with Color Scales
Assume you can select ranges, enter formulas, and apply basic cell formatting. This chapter uses Excel’s Conditional Formatting tools to reveal patterns in a table.
Showing distribution with color scales
A color scale assigns colors according to relative values. A two-color scale can show low and high values. A three-color scale adds a midpoint.
- Select the numeric range.
- Choose Home > Conditional Formatting > Color Scales.
- Select a preset, or choose More Rules to set the minimum, midpoint, and maximum colors.
Color scales show distribution, not fixed thresholds. A value may receive a different color after the range changes because Excel recalculates its position within the selected values.
Classifying values with icon sets
Icon sets classify values into visual groups, such as high, medium, and low. Select the range, then choose Home > Conditional Formatting > Icon Sets. In More Rules, you can change the thresholds and choose whether to display only the icons.
Controlling which cells a rule covers
The Applies to range determines where a rule can format cells. Open Home > Conditional Formatting > Manage Rules, select the rule, and edit Applies to.
Writing formula-based rules
Choose New Rule > Use a formula to determine which cells to format. The formula must return TRUE or FALSE. For example, applied to A2:E50, this rule highlights an entire row when column C exceeds 1000:
=$C2>1000Apply a format, such as a fill color, and confirm the rule. Excel evaluates the formula separately for each cell in the Applies to range.
Getting references right: relative, absolute and mixed
A relative reference changes as Excel evaluates different cells. An absolute reference stays fixed. A mixed reference fixes either the column or the row.
| Reference | Behavior |
|---|---|
| `C2` | Row and column can change |
| `$C$2` | Row and column stay fixed |
| `$C2` | Column stays fixed; row can change |
| `C$2` | Row stays fixed; column can change |
For row highlighting, $C2 is usually correct: every cell checks column C, while each row checks its own value. For a fixed comparison cell, use an absolute reference such as $H$1.
Exercise
You apply a rule to A2:E50 and want to highlight rows where column B contains an entry but column C is empty. Which formula should you use?
Show answer
Use =AND($B2<>"",$C2=""). The columns stay fixed while the row changes.