How to change row color based on a single cell's value? [duplicate]

Solution 1:

You can do this with formula-based conditional formatting.

  1. Select the cells you want to apply the formatting to.
  2. On the Home tab, click on "Conditional formatting" → "Manage rules..."
  3. Click "New Rule..."
  4. Select "Use a formula to determine which cells to format"
  5. In the formula field, enter the following: =SEARCH("Due in", $C1) > 0
    Instead of C1, use the cell that contains the texts you want to check. But note the $ sign in front of it - that tells Excel to keep the column the same as it expands the formula across the row. That's the trick to applying formatting to an entire row based on a single cell's value.
  6. Click "Format..."
  7. Select the colour you want on the Font tab (if you meant text colour) or the Fill tab (if you meant background colour), as well as any other formatting options you want
  8. Click OK twice
  9. Once back in the Rules Manager, click Apply to see the formatting in effect, and make sure it's how you wanted
  10. Repeat steps 3-8 for the other texts you want to check for, each time selecting the proper colours
  11. Click OK or Close to exit the Rules Manager

That should do it.

Solution 2:

Use a conditional format with a formula like =INDIRECT("C"&ROW())="Past Due" and set the background color to red. Add similar rules for the other formats you want to apply. Replace "C" with the actual column holding the values you want to check.