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 the range in column C that you want to format. C2 should be the top cell in the selection, and also the active cell.
Use =P2 as formula instead of =P2="TRUE".
HansVogelaar I am trying to change the font colour of cell C2 if A2="Target to Liq" and for this to apply down the column i.e., change the font colour of cell C6 if A6="Target to Liq". Could you advise please? Many thanks!
- HansVogelaarMar 14, 2024MVP
Select C2:C100 or however far down you want. C2 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=$A2="Target to Liq"
Click Format...
Activate the Fill tab.
Select a highlight color.
Click OK, then click OK again.- lamachinoSep 10, 2024Copper ContributorThanks a lot .. it worked perfectly.
Is it possible to copy pest this conditional formatting to other cells?
Like I have done $B2 Blue fill, if $C2 have text "Yes" by using your formula, =$C2="Yes".
Now want to the same to be applied to B3......B20 based on values in C3...... C20
how may i do this ?- SergeiBaklanSep 10, 2024Diamond Contributor
Just apply the rule to $B$2:$B$20 with the same formula =$C2="Yes"
- MeiOoiMar 15, 2024Copper Contributor
HansVogelaar Thanks but the cells below C2 are still referencing A2, instead of C3 referencing A3, C4 with A4. Any further advise?
- HansVogelaarMar 15, 2024MVP