Sub topic 3
Common patterns: row highlighting, duplicates, and overdue dates
This chapter assumes you can select ranges such as A2:F100, enter simple formulas, and tell relative references (A2) from absolute references ($A$2). Custom formula rules return TRUE or FALSE for each cell in the range, and Google Sheets applies the format when the result is TRUE.
Common patterns
To highlight whole rows, apply this rule to A2:F100:
=$C2="Done"The $ locks column C, so every column in the row checks the same status cell. The row number stays relative, so each row checks its own value.
To flag duplicates, apply this rule to A2:A100:
=COUNTIF($A$2:$A$100,$A2)>1To flag overdue open tasks, apply this rule to A2:E100, where column D holds the due date and column E holds the status:
=AND($D2<TODAY(),$E2<>"Done")How rule order decides which format wins
When two rules match the same cell and both set the background color, the rule higher in the list wins. Rules that set different properties, such as bold text and background color, both apply. Open Format > Conditional formatting to see the list, and drag rules to reorder them.
Editing, copying, and deleting rules
Click a rule in the Conditional format rules panel to change its range, condition, or format. To copy a rule, select a cell that has it, then choose Edit > Paste special > Conditional formatting only, and paste onto the target range. To delete a rule, click the trash icon beside it.
Using data from another sheet with INDIRECT
INDIRECT turns a text string into a cell reference, so you can name another sheet in quotes. This rule, applied to A2:A100, highlights values that also appear in column A of a sheet named Lists:
=COUNTIF(INDIRECT("Lists!A:A"),$A2)>0> Note: INDIRECT recalculates often. Keep the range bounded, such as "Lists!A2:A500", instead of a whole column when the sheet is large.
Replace the block quote above with the callout below in your final answer.
Troubleshooting rules
- Wrong cells highlight: Check the Apply to range. Google Sheets evaluates the formula relative to the top-left cell of that range.
- Nothing highlights: Check that the formula returns TRUE for the first data row. Look for stray spaces in text values and for curly quotes that should be straight.
- Wrong color shows: Check rule order. An earlier rule with the same property wins.
Exercise:
Exercise
Your rule on A2:F100 uses =C2="Done", and only column C highlights. Why, and how do you fix it?
Show answer
Column C has no $, so as the rule moves across columns it checks D2, E2, and F2. Change the formula to =$C2="Done".