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
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
make formula to set D to the color name (hide it if you need):
YELLOW, if Date() <14 days
RED , if Date() > B

then set B color condition based on the word in D.
 
Upvote 0
make formula to set D to the color name (hide it if you need):
YELLOW, if Date() <14 days
RED , if Date() > B

then set B color condition based on the word in D.
If I do that using Date(), won't it pull the current date and not the date from the cell?
 
Upvote 0
Does this give you what you want?
Book1
ABC
1Planned End DateStatus
210/29/2023OPEN
311/5/2023OPEN
411/16/2023OPEN
510/29/2023CLOSED
611/5/2023CLOSED
711/16/2023CLOSED
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B7Expression=AND(C2<>"CLOSED",B2<TODAY())textYES
B2:B7Expression=AND(C2<>"CLOSED",(B2-TODAY())<=14)textYES
 
Upvote 0
Does this give you what you want?
Book1
ABC
1Planned End DateStatus
210/29/2023OPEN
311/5/2023OPEN
411/16/2023OPEN
510/29/2023CLOSED
611/5/2023CLOSED
711/16/2023CLOSED
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B7Expression=AND(C2<>"CLOSED",B2<TODAY())textYES
B2:B7Expression=AND(C2<>"CLOSED",(B2-TODAY())<=14)textYES
How do I apply that to the entire column?
 
Upvote 0
Does this give you what you want?
Book1
ABC
1Planned End DateStatus
210/29/2023OPEN
311/5/2023OPEN
411/16/2023OPEN
510/29/2023CLOSED
611/5/2023CLOSED
711/16/2023CLOSED
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:B7Expression=AND(C2<>"CLOSED",B2<TODAY())textYES
B2:B7Expression=AND(C2<>"CLOSED",(B2-TODAY())<=14)textYES
The problem I'm running into is it looks like I'll have to apply conditioning to every row separately. When I use your formula, it only applies to that one row. I can't copy that formula to the rest of the column because it'll apply what ever is in C2 to apply to all the cells in column B.
 
Upvote 0
When setting up the conditional formatting, in the "Applies to" box, set the range to whatever you think you will need (not the entire column). The formula is not absolute referenced to C2 - it will automatically adjust down the column, as you can see from the example I gave.
 
Upvote 0
When setting up the conditional formatting, in the "Applies to" box, set the range to whatever you think you will need (not the entire column). The formula is not absolute referenced to C2 - it will automatically adjust down the column, as you can see from the example I gave.
This is what happens when I do that.

1698677887897.png
1698677906125.png
 
Upvote 0
Compare your formula to what I have in post #4. It's different.
 
Upvote 0
Compare your formula to what I have in post #4. It's different.
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.

1698680561523.png
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,115
Members
453,021
Latest member
Justyna P

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