Beginner 7 min read

Format Cells Based on Another Cell (Google Sheets)

Learn how to use conditional formatting based on another cell in Google Sheets. Step-by-step custom formula examples with cell references and dynamic thresholds.

SB

Sheets Bootcamp

March 3, 2026

Conditional formatting based on another cell in Google Sheets lets you change one cell’s appearance based on a value in a different cell. Instead of the built-in rules that check a cell against itself, you write a conditional formatting custom formula that references another column or a fixed cell. This unlocks patterns like highlighting revenue when a region matches, or color-coding rows when a status changes.

In This Guide

How Cell References Work in Conditional Formatting

Built-in conditional formatting rules (like “Greater than” or “Text contains”) only compare a cell to a fixed value. To format based on another cell, you need the Custom formula is rule type.

The formula you enter is evaluated relative to the first cell in the “Apply to range” field. If your range starts at F2, the formula runs as though it’s in cell F2 first, then shifts down to F3, F4, and so on.

This is where the dollar sign ($) matters:

ReferenceBehaviorUse Case
$C2Column locked to C, row shiftsCheck column C for every row
$C$2Both lockedReference one fixed cell
C2Both shiftRarely needed in conditional formatting
Important

The dollar sign controls what stays fixed as the formula moves through each cell in the range. Getting this wrong is the number one reason conditional formatting based on another cell fails.

Step-by-Step: Format Based on Another Column

We’ll use a sales records table with 10 transactions. The goal: highlight Revenue cells (column F) green when the Region (column C) is “Hogwarts.”

Sample Data

ABCDEFG
1DateSalespersonRegionProductUnitsRevenueCommission
21/5/2026Fred WeasleyDiagon AlleyExtendable Ears12$239.88$24.00
31/7/2026Ginny WeasleyHogsmeadeSelf-Stirring Cauldron8$360.00$36.00
41/8/2026Lee JordanDiagon AlleyRemembrall15$525.00$52.50
51/10/2026Fred WeasleyDiagon AlleyOmnioculars5$325.00$32.50
61/12/2026George WeasleyHogsmeadeSneakoscope20$570.00$57.00
71/14/2026Ginny WeasleyHogwartsNimbus 200025$624.75$62.50
81/15/2026Lee JordanHogsmeadeExtendable Ears10$199.90$20.00
91/18/2026Fred WeasleyDiagon AlleyInvisibility Cloak3$269.97$27.00
101/20/2026George WeasleyHogwartsFirebolt8$336.00$33.60
111/22/2026Ginny WeasleyHogsmeadeDeluminator6$330.00$33.00

Sales records spreadsheet with 10 transactions showing Date, Salesperson, Region, Product, Units, Revenue, and Commission columns

1

Select the range to format

Highlight cells F2 through F11 — the Revenue column. This is the range that will receive the formatting, even though the condition checks a different column.

2

Open conditional formatting and choose Custom formula is

Go to Format > Conditional formatting. In the Format rules dropdown, select Custom formula is and enter:

Formula
=$C2="Hogwarts"

The $C locks the column to C (Region). The 2 is relative and shifts for each row. When the formula evaluates row 7, it checks $C7="Hogwarts" — which is TRUE for Ginny Weasley’s Nimbus 2000 transaction.

3

Choose a fill color and apply

Click the paint bucket icon and select green. Click Done.

4

Review the result

Two Revenue cells are highlighted green: $624.75 (row 7, Ginny Weasley at Hogwarts) and $336.00 (row 10, George Weasley at Hogwarts). Every other Revenue cell stays white because its corresponding Region cell is not “Hogwarts.”

Revenue cells F7 and F10 highlighted green where Region column equals Hogwarts

Use a Cell as a Dynamic Threshold

Instead of hardcoding a value into the formula, reference a cell that holds the threshold. This way, you change one cell and the formatting updates across the entire range.

Suppose cell I1 contains 400. Apply this rule to F2:F11:

Formula
=F2>$I$1

The $I$1 is fully locked — every cell in the range compares its Revenue value against the same threshold in I1. Three cells are highlighted: $525.00, $570.00, and $624.75 (all above 400).

Revenue cells above threshold value in cell I1 highlighted green

Change I1 to 300 and the formatting instantly updates to include $360.00, $325.00, $336.00, and $330.00 as well.

Tip

A dynamic threshold is useful when you share a spreadsheet with others. They can adjust the threshold without editing the conditional formatting rule.

Practical Examples

Example 1: Color-Code Revenue by Region

Apply three separate rules to F2:F11, in this order:

  1. =$C2="Hogwarts" → Blue fill
  2. =$C2="Hogsmeade" → Yellow fill
  3. =$C2="Diagon Alley" → Green fill

Each rule checks the Region column for the current row and applies a different color to the Revenue cell. The result: a color-coded Revenue column where you can see which region each transaction belongs to at a glance.

Revenue column color-coded by region with blue for Hogwarts, yellow for Hogsmeade, and green for Diagon Alley

Example 2: Highlight When Units Exceed a Threshold

Format the Product column (D2:D11) to highlight product names when the Units column (E) exceeds 15:

Formula
=$E2>15

Two Product cells are highlighted: Sneakoscope (20 units in row 6) and Nimbus 2000 (25 units in row 7). No other row exceeds 15 units.

Example 3: Format Based on a Text Status

If you add a Status column (H) with values like “Complete” or “Pending,” you can highlight the Salesperson column based on that status:

Formula
=$H2="Complete"

Applied to B2:B11, this highlights any salesperson name where the corresponding Status cell says “Complete.” The formula checks column H for every row, and the formatting applies to column B.

Common Mistakes

Forgetting the dollar sign on the column reference

If you write =C2="Hogwarts" instead of =$C2="Hogwarts", the column reference shifts as the formula moves across the range. For cell F2, the formula checks C2 (correct). But for cell G2, it checks D2 (wrong). Locking the column with $C ensures the formula always checks the Region column.

Applying the rule to the wrong range

If you select A2:G11 but only want the Revenue column formatted, the formatting appears in every column. Select only the cells you want to change color — in this case, F2:F11. The formula can reference any cell on the sheet, but the “Apply to range” controls which cells actually get formatted.

Text comparison is case-sensitive

=$C2="hogwarts" does not match “Hogwarts” because the comparison is case-sensitive. Either match the exact casing or use LOWER: =LOWER($C2)="hogwarts".

Warning

If your formula works when you test it in a regular cell but does nothing in conditional formatting, check that you selected “Custom formula is” from the dropdown. Other rule types ignore formula syntax and treat it as a literal text comparison.

Tips

Tip

Test formulas in a cell first. Enter =$C2="Hogwarts" in an empty cell next to your data to verify it returns TRUE and FALSE for the correct rows. Then paste it into the conditional formatting rule.

Name your threshold cells. If you use a dynamic threshold in I1, add a label in H1 like “Threshold” so collaborators know what the cell controls.

Combine with data validation. Use a data validation dropdown in your threshold cell to restrict inputs to valid values. This prevents someone from accidentally entering text where a number is expected.

Frequently Asked Questions

How do I apply conditional formatting based on another cell value?

Use a Custom formula is rule. Select the range to format, choose “Custom formula is” from the dropdown, and enter a formula that references the other cell. For example, =$C2="Hogwarts" applied to F2:F11 highlights Revenue cells where the Region column says “Hogwarts.” The $C locks the column reference so the formula always checks column C.

Can I reference a cell in conditional formatting Google Sheets?

Yes. Choose “Custom formula is” as the rule type and write a formula that points to any cell. Use a dollar sign to lock the column or row reference as needed. The formula evaluates relative to the first cell in the “Apply to range” field, and the references shift row by row.

How do I use a cell reference as a threshold in conditional formatting?

Enter a formula like =F2>$I$1 where I1 contains your threshold value. The absolute reference $I$1 stays fixed so every cell in the range compares against the same threshold. Change the value in I1 and the formatting updates instantly without editing the rule.

Why is my conditional formatting based on another cell not working?

The most common cause is a missing or misplaced dollar sign. If your formula references a column that should stay fixed, lock it with a dollar sign like $C2. Also verify you selected “Custom formula is” from the dropdown — other rule types treat formula syntax as literal text. Finally, check that the text casing matches exactly, since comparisons are case-sensitive.

Frequently Asked Questions

Next Steps

Continue learning with these related tutorials: