Forum Discussion
conditional formatting based on content of another cell
- Apr 13, 2021
Select the cells that you want to format conditionally. If more than one, the top left cell should be the active cell in the selection. Note the address of this cell.
On the Home tab of the ribbon. select Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter a formula that evaluates to TRUE (or a non-zero number) if the rule should be applied, and to FALSE (or 0) otherwise.
In your example, let's say A2 is the active cell in the selection.
Use the following formula:
=B2<>""
Click Format...
Activate the Fill tab.
Specify the desired color (green in your example).
Click OK, then click OK again.
Select D2:P62.
D2 should be the active cell in the selection.
On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Use a formula to determine which cells to format'.
Enter the formula
=AND(D2<TODAY(), ISNUMBER($C$2))
Click Format...
Activate the Font tab.
Select red as text color.
Click OK, then click OK again.
HansVogelaar Thank you for that.
I've realised another requirement for this - where C2 is in the formula, this needs to be from C2:C62.
For example, if C32 reads 31-Mar-2024, I'd like the date in D32 to show as red and so on.
Thanks, once again.
- HansVogelaarApr 02, 2024MVP
- laurablowApr 02, 2024Copper ContributorThank you so much!