Sub topic 2
Shading numbers with color scales
This chapter assumes you can select a range such as B2:B50, open the conditional formatting panel, and read a simple formula. You should also know that a cell reference such as C2 shifts when a formula is copied.
A color scale is a conditional formatting rule that colors each number in a range along a gradient. The smallest value takes the minimum color, the largest takes the maximum color, and values in between take a blend of the two. Use it to spot high and low figures at a glance.
To create one, select the range, then choose Format > Conditional formatting. Open the Color scale tab. Set a minpoint, an optional midpoint, and a maxpoint. Each point has a type:
| Point type | Meaning |
|---|---|
| Min / Max | The smallest or largest value in the range |
| Percentile | The value at a chosen percentile, such as 50 for the median |
| Number | A fixed value you type |
| Formula | A value computed by a formula |
Setting the midpoint to Percentile 50 keeps the center color on the median, so a few outliers do not shift the whole gradient.
Relative and absolute references in rule formulas
A formula rule reads its references relative to the top-left cell of the range, and Google Sheets adjusts them for each cell. A dollar sign fixes the part it precedes. $C2 locks column C while the row changes. C$2 locks row 2 while the column changes. $C$2 locks both.
Writing custom formula rules
To color whole rows, select A2:F100, open the Single color tab, and choose Custom formula is. Enter a formula that returns TRUE when a row should be colored:
=$C2="Done"Applied to A2:F100, this formula colors each row whose column C reads Done. Without the $ before C, the reference would shift to D, E, and onward for each column, so the rule would test the wrong cells.
Exercise
A range B2:B50 holds sales figures. Which point type keeps the midpoint color on the median?
Show answer
Percentile, set to 50.