Search code examples
google-sheetsgs-conditional-formatting

How do I conditionally format a cell in Google Sheets based on matching values in 2 other columns?


So here is what I am trying to do. I have a value in C1 let's say. I would like to like to highlight that cell if:

  • The value in B1 exists somewhere else in Column B(I'll call it Bn)
  • The values for A1 and An in this other row also match

So if B1 is 12:00 and A1 is Foo I want to highlight C1 if a cell(Bn) in Column B is 12:00 and the value of An is Foo.

Make sense?


Solution

  • 1.Click the Format menu and select Conditional formatting....

    2.Switch to the "Custom formula" option in the drop-down menu.

    3.Add in the relevant formula, rules, and cell range.

    Formula: =AND(COUNTIF(A:A,A1)>1,COUNTIF(B:B,B1)>1)

    Cell Range: $C - The entire C column

    4.Click Save rules.