Forum Discussion
How to change the background colour of a cell based on content of another cell
I am trying to format a cell based on another cell's content, the context is to link when a certain day is entered into a cell then a different cell will change colour, any suggestions?
OK, here's how to do it:
Let's say that the Day cells are D2:D50, and you highlight a cell if it contains "Sun".
And let's say the Date cells are H2:H50.
Select H2:H50. H2 should be the active cell in the selection.
On the Home tab of the ribbon, select Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula
=ISNUMBER(SEARCH("Sun",D2))
In this formula, "Sun" is the specific text in the conditional formatting rule for the Day cells, and D2 is the Day cell in the same row as the active cell.
Click Format...
Activate the Fill tab.
Select a colour.
Click OK, then click OK again.
8 Replies
You can create a conditional formatting rule of type 'Use a formula to determine which cells to format'.
If you would like more specific help, please provide more detailed information.
- Jon2020Copper ContributorI am trying to format the 'Date' cell in my spreadsheet to change colour dependent upon what is present in my 'Day' cell i.e. If it says Sunday then cell background colour changes to blue the some as the Sunday cell.
How is the 'Day' cell colored? Using conditional formatting or manually?