Sub topic 1
What Conditional Formatting Does and Where to Find It
Prerequisites
You should know how to open a Google Sheets spreadsheet, enter values and simple formulas, and select a range such as A2:F100. You should also understand basic cell references, such as A2 and C5.
What conditional formatting does
Conditional formatting changes a cell's appearance when its contents meet a condition. The appearance can include the background color, text color, bold text, italic text, or strikethrough. The rule changes how the cell looks, but it does not change the value stored in the cell.
For example, imagine a task list with a Status column:
| Task | Owner | Status |
|---|---|---|
| Draft outline | Sam | Done |
| Review data | Lee | In progress |
| Send report | Sam | Blocked |
A conditional formatting rule can give cells containing Done a green background, Blocked a red background, and In progress a yellow background. When you change a status, Sheets checks the rules again and updates the formatting.
This makes important information easier to scan. You can use conditional formatting to:
- Mark completed or blocked work.
- Find duplicate values.
- Show overdue dates.
- Highlight unusually high or low numbers.
- Shade a range from low values to high values.
- Emphasize an entire row based on one cell.
The main parts of a conditional formatting rule are:
| Part | Meaning |
|---|---|
| Apply to range | The cells that the rule can format |
| Condition | The test that decides whether formatting applies |
| Formatting style | The colors or text styles to use |
| Rule order | The position that helps decide which rule takes precedence |
A rule only evaluates the range listed in Apply to range. Selecting the correct range is therefore part of creating the rule. A rule applied to C2:C100 can format status cells, while a rule applied to A2:F100 can format whole task rows.
Where to find conditional formatting
- Open the spreadsheet.
- Select the cells that you want a rule to affect.
- Select Format in the top menu.
- Select Conditional formatting.
Google Sheets opens a conditional-formatting sidebar on the right. The sidebar includes an Apply to range field and a section for choosing the condition.
If you select a range before opening the sidebar, Sheets usually fills in the selected range automatically. You can edit that field if the range is too small or too large. You can also add more ranges to the same rule when appropriate.
The sidebar offers two main rule types:
- Single color applies one formatting style when a condition is true. Built-in conditions include options such as “Is not empty,” “Text contains,” “Date is,” and comparisons such as “Greater than.”
- Color scale uses a gradient to represent numbers. Lower, middle, and higher values receive different colors.
The sidebar also includes Custom formula is. This option lets you write a formula that returns TRUE or FALSE. It is useful when a built-in condition cannot express the rule you need, such as formatting a whole row based on the value in one column.
Do not confuse a color scale with a single-color rule. A single-color rule asks whether a condition is true and then applies one style. A color scale compares numeric values across a range and assigns colors based on their relative positions.
The rule evaluation cycle
Sheets evaluates a rule against the cells in its target range. When the underlying value changes, the result can change immediately. For example, a date that was in the future may become overdue after the current date passes.
The rule can evaluate:
- The value in the cell being formatted.
- A comparison with another value.
- Text or dates.
- A custom formula.
- Values from another location, when the formula is written to reference them.
The condition and the formatting style are separate. You can keep the same condition and change the style from a yellow fill to bold red text. You can also create several rules for the same range, which makes rule order important. Those details become more important as a sheet grows.
A first rule
To make a simple rule, select a range such as C2:C100, open Format > Conditional formatting, leave Single color selected, and choose a condition such as Text is exactly. Enter Done, choose a formatting style, and select Done.
Afterward, test the rule by entering Done in one target cell and a different value in another. The first cell should receive the chosen style. If no cell changes, check the range, the condition, and whether the entered text matches the condition exactly.
Exercise
You have status values in C2:C20 and want cells containing Blocked to have a red background. Which range and rule type should you start with?
Show answer
Select C2:C20, open Format > Conditional formatting, choose Single color, and set the condition to Text is exactly Blocked.