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.
Are you using the desktop version of Excel for Windows? Or Mac? Or are you using Excel Online (in the browser)?
- DHurleyMar 04, 2024Copper ContributorExcel on Mac version 16.82. Trying to have column C highlight red if column P contains TRUE. Formula '=P2="TRUE"'. But when applied to all rows, the is still '=P2="TRUE"' rather than '=P<row>="TRUE"'. How do I get the rule to change based on the row it applies to?
- tiller_bearAug 15, 2024Copper ContributorThis worked perfectly for me! Thank you
- HansVogelaarMar 04, 2024MVP
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".
- MeiOoiMar 14, 2024Copper Contributor
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!