# Conditional formatting based on another cell in Sheets

URL: https://goingstellar.ro/reference/sheets/recipes/conditional-formatting-another-cell/

Use Format → Conditional formatting → Custom formula is, and write a formula that points at the cell you test. Lock the column letter with a dollar sign, as in the first example, so a whole row follows column C. The same formulas in a helper column return TRUE or FALSE per row, a quick preview of what gets colored.

## Steps

1. Select the cells to color, for example A2:C6. The first cell of the selection, A2, is the one the formula is written for.
2. Open Format → Conditional formatting and choose Custom formula is under the rule type.
3. Write the test with the other cell. To color a full row from column C, lock the column, as in the first example.
4. For text, compare with a quoted value, as in the third example.
5. To compare with one cell that never moves, lock both its column and its row, as in the fourth example.
6. For a cell on another tab, wrap the reference in INDIRECT, as in the fifth example.
7. Pick the fill color and confirm. Preview the rule first with the matching helper formula if the result looks wrong.

## Examples

The examples use this table, starting in A1:

| Qty | Status | Amount | 100 |
|---|---|---|---|
| 120 | Done | 150 |
| 40 | Open | 80 |
| 150 | Done | 100 |
| 90 | Open | 220 |
| 200 | Done | 101 |

```
=$C2>100
```

Result: `TRUE`

The rule for a whole-row color, written for the first cell A2. It reads column C, so TRUE means the Amount in this row is above 100. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=ARRAYFORMULA($C2:$C6>100)
```

Result: 

| TRUE |
|---|
| FALSE |
| FALSE |
| TRUE |
| TRUE |

The same test for all five rows in one cell. The TRUE rows are the ones the rule colors, across every column of the range. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=ARRAYFORMULA($B2:$B6="Done")
```

Result: 

| TRUE |
|---|
| FALSE |
| TRUE |
| FALSE |
| TRUE |

A text condition: TRUE where Status equals Done. The same rule colors the full row of every Done order. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=ARRAYFORMULA(A2:A6>$D$1)
```

Result: 

| TRUE |
|---|
| FALSE |
| TRUE |
| FALSE |
| TRUE |

Comparison with one fixed cell. D1 holds the limit 100, locked with dollar signs, so every row is compared with the same value. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=ARRAYFORMULA(A2:A6>INDIRECT("Sheet1!$B$2"))
```

Result: 

| TRUE |
|---|
| FALSE |
| TRUE |
| TRUE |
| TRUE |

Comparison with a cell on another tab. INDIRECT builds the reference from text, here Sheet1!B2, which holds 42. This is the form the rule accepts. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=D2>100
```

Result: `FALSE`

What the rule without dollar signs, =C2>100, asks for cell B2: the reference shifts one column right to D2, which is empty, so the answer is FALSE. Run in a Google Sheet (English US locale) on 2026-11-29.

## Common errors

- Without the dollar sign the reference moves with each cell. the rule C2>100 on A2:C6 colors only column A, because column A looks at C and the other columns look at empty cells. The API read-back shows it: only the Qty cells are colored.
- With the column locked, the colored rows are the ones where Amount is above 100: rows 2, 5 and 6 of the example, in every column of the range. Amount 100 is not above 100, so row 4 stays plain.
- The rule asks about the first cell of the range and Sheets adjusts it for the others. Write the formula for the top-left cell, not for the row you care about.
- A direct reference to another tab, Sheet1!B2 written straight into the rule, works in a normal cell but the API refused it as a rule. The INDIRECT version was accepted and colored rows 2, 4, 5 and 6, those above 42. Whether the editor dialog accepts the direct form was not checked.

## Questions and answers

### Can the rule look at a cell in another column of the same row?

Yes. Lock the column and leave the row free, as in the first example. Every selected cell in that row then reads column C.

## Compared with Excel

In Excel the path is Home → Conditional Formatting → New Rule → Use a formula to determine which cells to format. The dollar-sign logic for rows and fixed cells is the same. The INDIRECT workaround for another tab was needed only in Google Sheets as measured here; Excel was not tested.

## Functions used

- [INDIRECT](https://goingstellar.ro/reference/sheets/indirect/)
- [ARRAYFORMULA](https://goingstellar.ro/reference/sheets/arrayformula/)
- [AND](https://goingstellar.ro/reference/sheets/and/)

## Sources

- [Apply conditional formatting rules (Docs Editors Help)](https://support.google.com/docs/answer/78413)
- [INDIRECT (Docs Editors Help)](https://support.google.com/docs/answer/3093377)
- [ARRAYFORMULA (Docs Editors Help)](https://support.google.com/docs/answer/3092959)

