Search code examples
google-sheetsgoogle-sheets-formulaconditional-formatting

Google Sheets - conditional formatting on two columns based on two columns in a different sheet


I've looked at similar questions and answers but haven't been able to get it to work for me, unfortunately. I just can't really wrap my head around the answers well.

I have two sheets in a file, let's just say sheet 1 and sheet 2. On sheet 1 I have two columns to which I want to apply conditional formatting. On sheet 2 I have two columns which the info is checked against.

The contents of the cells in column A and B on any given row must exactly match the contents of both cells in column A and B on sheet 2.

For example... if sheet 1 column A has "sheep" and column B has "grass", the cell becomes green if on sheet 2 column A also has "sheep" and column B has "grass". However, if sheet 1 column A is "sheep" and column B is "water", is does not become green even if "water" does appear in sheet 2 column B but with, say, "fish" in column A.

I hope that makes sense... I'm having trouble explaining it properly :(

I currently have a working version but with all the information manually added into the conditional formatting box. It does not pull any information from another sheet. It works but is a ton of work to edit.

I've tried pretty much all combinations of this, this and this that I could think of, but I'm very new to all of this so I've probably done something wrong.

I could not get the code in conditional formatting to validate; the box always keeps its red outline.


Solution

  • Within your Living Ability Formdex tab, select the range R2:S and apply the custom formula for CF

    =COUNTIFS(INDIRECT("CONFIG!A:A"),$R2,INDIRECT("CONFIG!B:B"),$S2)