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.
- HansVogelaarMar 19, 2024MVP
You don't need conditional formatting for that - you can use a formula.
Let's say you want NO in column B if the corresponding cell in column A is blank, starting in row 2.
In B2:
=IF(A2="", "NO", "")
Fill down.
- JricsMar 19, 2024Copper ContributorYes I know that but what I failed to mentions the first post was I need the "NO" to be Red and Bold and the "YES" to be Green and Bold.
- HansVogelaarMar 19, 2024MVP
Change the formula to
=IF(A2="", "NO", "YES")
Select B2:B100 or however far down you want.
On the Home tab of the ribbon, click Conditional Formatting > New Rule...
Select 'Format only cells that contain'.
Leave the first drop down set to 'Cell Value'.
Select 'equal to' from the second drop down.
In the box next to it, enter the formula="NO"
Click Format...
Activate the Font tab.
Select Bold
Activate the Fill tab.
Select red as highlight color.
Click OK, then click OK again.Repeat these steps, but with
="YES"
and green as fill color.