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 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.
Hi. I'm wondering if you can help me, too.
I am tracking weights in a spreadsheet and want to use conditional formatting to turn a cell either green or light red based on the weight from the previous day. Green if the weight has increased; red if it has decreased. my cell ranges are B2 through BF9 to account for now until July 13th.
Thank you!
- HansVogelaarMay 21, 2024MVP
Select C2:BF9 (we'll skip column B since there is no previous value). 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=AND(B2<>"", C2<>"", C2>B2)
Click Format...
Activate the Fill tab.
Select green as fill color.
Click OK, then click OK again.Repeat these steps, but with the formula
=AND(B2<>"", C2<>"", C2<B2)
and red as fill color.
- AmyOatMay 23, 2024Copper Contributor
HansVogelaar Sorry, I'm hoping you may be able to help me too?
I'm trying to format my 'to do' list for an upcoming event. Column 'B' has the task, column 'C' has the due date, and column 'E' has the status of the task ('in progress' or 'complete'). I have conditional formatting set up so that the due date (column 'C') turns blue if it is due in the next 2 weeks, yellow if it due in the next week and red if the due date has passed. I then also have conditional formatting set up so that the status (column 'E') is yellow if it is 'in progress' and green if it is 'complete'.
What I would now like to do is set up a formula so that if column 'E' is set to 'complete' the conditional formatting changes for column 'C' (due date) to grey or some colour. At the moment tasks that I have previously completed and are passed their due date are still showing as red and it makes it harder to see what still needs doing.
Hope that makes sense and that you have a solution. Thanks!- HansVogelaarMay 23, 2024MVP
Select the cells in column C that you want to format. I'll assume that C2 is the top cell in the selection and that it is 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=$E2="Complete"
Click Format...
Activate the Fill tab.
Select gray as fill color.
Click OK, then click OK again.