Conditional formating One Column against another?

kccarson002

New Member
Joined
Feb 6, 2018
Messages
3
Hi there,

What I am trying to do is conditionally format a comments column based on what control code is used. so that if a certain project code is used the comments column turns red UNTIL IT IS FILLED OUT. Once the comments section is filled out correctly it should go back to the regular color. If the control code used is a non- project code the comments column should grey out.

I am using a drop down box for the control codes that is on another tab in the workbook. Please help! I know it has something do with conditional formatting with formulas but I am uncertain which should be used.

[TABLE="width: 1604"]
<tbody>[TR]
[TD]Month[/TD]
[TD]Day[/TD]
[TD]Control
Code[/TD]
[TD]Activity[/TD]
[TD]Minutes[/TD]
[TD]Hours[/TD]
[TD]Work
Type [/TD]
[TD]Auditor[/TD]
[TD]Advise / Consultation Project [/TD]
[TD]Comments[/TD]
[/TR]
[TR]
[TD]01 - January[/TD]
[TD]1[/TD]
[TD]5 - Holiday[/TD]
[TD]Holiday[/TD]
[TD]480[/TD]
[TD]8.0[/TD]
[TD] [/TD]
[TD]Joe[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col><col><col span="2"><col><col></colgroup>[/TABLE]
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Welcome to the Board!

Let' say that Control Code is in column C and Comments is in column J.
Then, to Conditional Formatting cell J2 if Control Code is "5 - Holiday" and Comments is blank, use this Conditional Formatting formula in cell J2:
Code:
=AND(C2="5 - Holiday",J2="")
and choose your formatting color.
 
Upvote 0
Is there a way to do this with all of the control codes at once? there are 125 different ones that can be selected from. Is there a way to turn the cell back to blank after the text has been entered in the comments? Is there a way to apply this to the entire column whenever the control code is used?
 
Upvote 0
Is there a way to do this with all of the control codes at once? there are 125 different ones that can be selected from.
Do you mean that rather than checking for a specific entry in column C, you are just looking for ANY entry in column C?
If so, then just use:
Code:
=AND(C2<>"",J2="")
Is there a way to turn the cell back to blank after the text has been entered in the comments?
You don't have to. Conditional Formatting will do this automatically, dynamically. What happens is that whenever a cell value is changed, it re-evaluates. If the conditions are met, the Conditional Formatting will be applied.
If not, then the Conditional Formatting will NOT be applied. So once you populate column J, the formula we wrote evaluates to FALSE, and the Conditional Formatting will not color that cell any longer (unless you were to remove the column J entry again!).
Is there a way to apply this to the entire column whenever the control code is used?
Yes. Select the entire range you want to apply this to, and the write the Conditional Formatting formula as it applies to the FIRST cell in your selection. Excel is smart enough to adjust it for the other rows.
So, if you select range J2:J100 (or whatever row you are ending on), the formula I gave you will work, as-is.
If you decide to select the ENTIRE column J, then the first cell in your selection is cell J1, so you would need to update the formula like this:
Code:
=AND(C1<>"",J1="")
 
Upvote 0

Forum statistics

Threads
1,223,098
Messages
6,170,103
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top