Sub topic 2
Choosing the Range a Rule Applies to
Prerequisites and the basic model
This chapter assumes you can navigate Google Sheets, enter values and simple formulas, and select ranges such as A2:F100.
Conditional formatting changes a cell's appearance when a condition is true. The apply range is the group of cells that can receive that appearance. A rule can test one cell but format many cells, so choosing the range is as important as writing the condition.
For example, suppose a task list uses these columns:
| A | B | C | D | E | F |
|---|---|---|---|---|---|
| Task | Owner | Status | Due date | Priority | Notes |
If you want to highlight every task whose status is Done, the range A2:F100 formats complete rows. The range C2:C100 formats only the status cells.
Select the range before creating a rule
To create a rule for a specific range:
- Select the cells you want the rule to affect.
- Open Format > Conditional formatting.
- Check the Apply to range field.
- Choose a condition, such as Text is exactly or Greater than.
- Choose the formatting style.
- Select Done.
The range can be a single cell, a column segment, a row segment, or a rectangular block. Sheets usually fills in the selected range automatically, but verify it before saving the rule.
You can also type a range directly in Apply to range. Common examples include:
A2:A100formats one column from row 2 through row 100.A2:F100formats six columns across 99 rows.A:Aformats the entire column.2:2formats the entire second row.A2:Fformats columns A through F starting at row 2.
Using a bounded range, such as A2:F1000, often makes a sheet easier to manage than formatting an entire column. It limits the rule to the rows where data is expected.
Match the range to the intended result
The same condition can produce different results depending on the apply range.
Suppose column C contains statuses and some cells contain Done.
| Apply to range | Result |
|---|---|
| `C2:C100` | Only cells containing `Done` in column C receive the format. |
| `A2:F100` | The rows containing `Done` in column C receive the format across columns A through F. |
| `A2:A100` | Only task names in column A receive the format. |
For a built-in rule such as Text is exactly, Sheets tests each cell in the apply range. If the rule applies to A2:F100, a text condition normally checks each cell in that block. That may not be what you want when the condition is stored in one status column.
When a condition in one column should control formatting across a row, use a custom formula rule. The apply range still determines the cells that are colored. The formula determines which rows qualify. For example, when applied to A2:F100, this formula checks the status in column C:
=$C2="Done"The dollar sign fixes the column at C, while the row number remains relative. The custom formula is covered in detail later, but the important point here is that the formula and the apply range work together.
Include future rows deliberately
If new records will be added later, include extra blank rows in the range. For example, A2:F1000 lets the rule cover future tasks through row 1000.
Blank rows usually remain visually unchanged because they do not meet the condition. However, a broad range can make a rule slower or harder to inspect, especially in a large workbook. Choose a limit that fits the sheet's expected size.
For a continuously changing dataset, applying a rule to an entire column can be convenient. It can also affect headers or unrelated content. If you use A:A, make sure the header cell is compatible with the rule, or start at A2 to exclude the header.
See the relationship between range and condition
Change the range after creating a rule
To inspect or change an existing range:
- Open Format > Conditional formatting.
- Select the rule in the side panel.
- Edit Apply to range.
- Add another range with the range-picker control if needed.
- Select Done.
You can give one rule multiple nonadjacent ranges. For example, a rule might apply to A2:F100 and A105:F200. This is useful when a sheet has separate sections with the same structure.
Before saving, ask two questions:
- Which cells should change color?
- Which cells contain the values that decide whether the rule is true?
The answers may describe different ranges. If so, a custom formula can connect them while the apply range controls the visible result.
Exercise
A task sheet stores status in C2:C100. You want the entire task row, from columns A through F, to be formatted when the status is Done. What apply range should you use?
Show answer
Use A2:F100. The later custom formula rule can check each row's value in column C while the apply range formats the full row.