Conditional Formatting Based On Time Remaining Between Dates

thlnk

New Member
Joined
May 23, 2019
Messages
4
Hi there,

I've lurked these forums for a while now and have always been able to find and answer to my excel questions.
However this time I'm stuck.

I'm trying to apply conditional formatting to cells based on when the due date is.

For example: "D3" has an initiated date of 23/05/2019, "E3" has a due date of 04/07/2019.

I would like to highlight "E3" as red if it is over due, yellow if 50% of the time has passed before the due date or green if it's under 50% of time remaining.

I've tried to no avail DATEDIF, nested if/and functions, etc and I'm completely stuck.

Any help would be immensely appreciated.

Thank you for your time.

Kyle
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
G'day Kyle,

The following will work as you want - two CF rules that assume the natural colour of the cell is green i.e all dates start with more than 50% of the time remaining.

<yearfrac($e$3,$d$3,1) 2
Add this formula first to turn the cell yellow: =YEARFRAC($E$3,TODAY(),1)"<"YEARFRAC($E$3,$D$3,1)/2
then add this rule to handle the change to red: =TODAY()>$E$3

Cheers

shane

edited to fix HTML < issue - ignore " each side of < in the first equation</yearfrac($e$3,$d$3,1)>
 
Last edited:
Upvote 0
I can't fix the html issue in the previous message as the 10 minute editing window expired, so here it is in coherent this tume (I hope)

G'day Kyle

Give this a try - assuming the cell starts off as green in all cases that can be done without CF, then add

to turn cell yellow: =YEARFRAC($E$3,TODAY(),1) < YEARFRAC($E$3,$D$3,1)/2 (remove spaces from around the < that is a HTML issue with these posts) ,

then add

to turn cell red: =TODAY()>$E$3
 
Upvote 0

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

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