A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Apply two conditional-formatting rules directly to the entire range A1:A10, using A1 as the relative reference and $A$1:$A$10 only as the fixed Applies to range.
Configure the two rules
- Select A1:A10.
- Go to Home → Conditional Formatting → Manage Rules.
- Set Show formatting rules for to This Worksheet.
- Remove or replace the existing A1-only color rule.
- Select New Rule → Use a formula to determine which cells to format.
- For the yellow rule, enter:
=A1=TRUE - Select Format → Fill → Yellow, then select OK.
- Create a second rule with:
=A1=FALSE - Set its fill to Green.
- In the Rules Manager, set Applies to for both rules to:
=$A$1:$A$10
Excel requires a conditional-formatting formula to return TRUE or FALSE. A relative reference such as A1 adjusts for each cell in the applied range, whereas $A$1 always checks A1.^1^ ^2^
The Rules Manager may continue to display A1 in both formulas. That is expected: A1 represents the top-left cell of the Applies to range. When Excel evaluates A2, the relative reference becomes A2; for A3 it becomes A3, and so on.
If the cells contain text rather than logical values
If A1:A10 contain the literal text "TRUE" and "FALSE" instead of Excel’s logical TRUE/FALSE results, use these rules instead:
=A1="TRUE"
=A1="FALSE"
Do not include a leading apostrophe in the conditional-formatting formulas. To identify the cell type, select a cell and inspect the formula bar:
-
=some_testreturningTRUEorFALSE: use=A1=TRUEand=A1=FALSE. - Literal text such as
TRUE, entered or returned as text: use the quoted versions.
The dollar signs in Applies to are correct because the formatted range should remain fixed. The cell reference inside each rule must remain relative so every row produces an independent result.
References