Google-sheets – How to apply formatting to a cell based on comparison with another cell

conditional formattinggoogle sheets

I'm working with Google's spreadsheets to keep a record of how many dragons of each breed/gender I have in a game I play. I have five columns:

A (Breed) | B (Male) | C (Male Goal) | D (Female) | E (Female Goal)

I want to highlight B with green if it is greater than or equal to C, red if it is less than C.

I want to highlight D with green if it is greater than or equal to E, red if it is less than E.

Obviously, I could use conditional formatting for each individual row to achieve this, but there's 116 rows so I was hoping there was a formula that would work for the entire column.

Best Answer

Here is what you can do:

  1. RightClick B2 → select Conditional formatting → select Custom Formula is (from the List)
  2. Enter the following formula in the textbox: =b2>=c2
  3. Check the Background Color and select green color
  4. Click on Add another rule
  5. Select Custom Formula is (from the List)
  6. Enter the following formula in the textbox: =b2<c2
  7. Check the Background Color and select red color
  8. Click on Save Rules
  9. Highlight B2 and click on Paint Format option on the tool bar.
  10. Now click on cell B3 and drag until cell - B117 (this should apply the conditional formatting on cell ranging from B3-B117)

And for your second condition (i.e., to highlight D with green if it is greater than or equal to E, red if it is less than E) - simply repeat the above steps by interchanging D2 for B2 and E2 for C2.