Highlight cell if date has passed

DTbox

New Member
Joined
Dec 14, 2022
Messages
16
Office Version
  1. 2019
Platform
  1. Windows
I know this seems simple but I've been researching this for a few hours and I'm come up blank. I'm looking to do the following two things with conditional formatting.

  1. I need a cell in Row B to go RED if the planned end date has passed and YELLOW if the planned end date is within 14 days of the date in the cell.
  2. Regardless of the date in Row B, if the status shows CLOSED in Row C, the cell in Row B goes back to normal, not showing a color.
Everything I've read online shows me how to do this based on todays date only. I don't want that. I need it based off the date in the Row B. Any help would be much appreciated.

1698415821733.png
 
Your "applies to " is out of alignment. Instead of $B$3:$B$11 it should read $B$2:$B$11. That's why you've getting incorrect results. I'll get back to you tomorrow if you still can't get it to work, after 2 am here...
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Weird, don't know why it was showing that. I corrected it and still have incorrect colors/conditions.

B1 should be red.
B4 should not be colored because the status is CLOSED.
B5 should be yellow.
B7 should not be colored because the status is CLOSED.
B8 should be red.
B9 should be yellow.

View attachment 101194
It's because your "Applies to" range is offset 1 row down. Shouldn't it be $B$2:$B$11, not $B$3:$B$11?
 
Upvote 0
Compare your formula to what I have in post #4. It's different.
I have it figured out as follows. Now the only part left is a formula that tells the conditional format in F to be ignored completely if H shows anything other than OPEN. Meaning I only want F to have a conditional format if the status of the task is in an OPEN status.
1698682851653.png


1698682869413.png
 
Upvote 0
=AND(F3="OPEN",F3<TODAY())
Also, I recommend you don't apply CF to an entire column.
 
Upvote 0
=AND(F3="OPEN",F3<TODAY())
Also, I recommend you don't apply CF to an entire column.

Did as suggested and it's not turning the cell with 9/22/2023 to show no conditional formatting.
1698694118385.png
 
Upvote 0
And again the formula you put in the CF isn't the formula I posted. You put in F5 in the top rule not F3...
 
Upvote 0
Here's another mini sheet with your new data layout (i.e. different from your original post) and your new formatting rules. Copy it to an empty worksheet, then you can copy the format to your actual file.

Book1
FGH
1
2Planned End DateTask End DateStatus
310/29/2023OPEN
411/5/2023OPEN
511/16/2023OPEN
610/29/2023CLOSED
711/5/2023CLOSED
811/16/2023CLOSED
9
10
11
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H3:H10Cell Valuecontains "OPEN"textYES
F3:F11Expression=AND(H3="OPEN",F3<TODAY())textYES
F3:F11Expression=AND(H3="OPEN",(F3-TODAY())<=14)textYES
 
Upvote 0
And again the formula you put in the CF isn't the formula I posted. You put in F5 in the top rule not F3...
I apologize, not trying to waste your time. I'm clicking on "3" not sure why 5 keeps appearing.

1698696166246.png
 
Upvote 0
I understand the CF doesn't copy from the XL2BB so you won't be able to copy the format. In any event, look at post #18. They are the formulas to use. "OPEN" is never in column F, it's in column H.
 
Upvote 0

Forum statistics

Threads
1,215,072
Messages
6,122,968
Members
449,095
Latest member
Mr Hughes

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