conditional format dates calculated using a formula

rd_CEM

New Member
Joined
Sep 12, 2024
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I have calibration dates that are 1 or 2 years from current, I need to highlight them to display items coming up for calibration 15 days prior to the due date and items that are past the due date. The dates (that need formatting) are displayed in column K and are calculated from the date from column J using =J5+365. I've tried several formulas from various posts with no luck. My Excel knowledge is limited, so I would greatly appreciate any help.

1726161443234.png
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Since you didn't mention any formatting and further conditions I made a small table to show you some examples:

MrExcel_202409.xlsm
ABCDE
1IDmt freqlastdue Ddelta
2001111/24/202211/24/2023-293
3002111/8/202211/8/2023-309
4003112/25/202312/24/2024103
5004111/6/202311/5/202454
6005111/3/202311/2/202451
7006111/20/202311/19/202468
800719/28/20239/27/202415
900819/20/20239/19/20247
1000919/13/20239/12/20240
Sheet1
Cell Formulas
RangeFormula
D2:D10D2= C2+365
E2:E10E2= D2-TODAY()
C8C8= TODAY()+15-365
C9C9= TODAY()+7-365
C10C10= TODAY()-365
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:E10Expression= TODAY()+15<$D2textNO
A2:E10Expression= TODAY()<=$D2textNO
A2:E10Expression=TODAY()>D$2textNO


Please let me know further details like formatting, other conditions, etc.
 
Upvote 0
Since you didn't mention any formatting and further conditions I made a small table to show you some examples:

MrExcel_202409.xlsm
ABCDE
1IDmt freqlastdue Ddelta
2001111/24/202211/24/2023-293
3002111/8/202211/8/2023-309
4003112/25/202312/24/2024103
5004111/6/202311/5/202454
6005111/3/202311/2/202451
7006111/20/202311/19/202468
800719/28/20239/27/202415
900819/20/20239/19/20247
1000919/13/20239/12/20240
Sheet1
Cell Formulas
RangeFormula
D2:D10D2= C2+365
E2:E10E2= D2-TODAY()
C8C8= TODAY()+15-365
C9C9= TODAY()+7-365
C10C10= TODAY()-365
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:E10Expression= TODAY()+15<$D2textNO
A2:E10Expression= TODAY()<=$D2textNO
A2:E10Expression=TODAY()>D$2textNO


Please let me know further details like formatting, other conditions, etc.
So what would I use for the formula to conditionally format the dates in column D 15 days prior to the date shown?
 
Upvote 0
This should do it:
Excel Formula:
= $K5 - 15 = TODAY()

MrExcel_202409.xlsm
JK
4Last PerformedDATE DUE
511/24/202211/24/2023
611/8/202211/8/2023
712/25/202312/24/2024
811/6/202311/5/2024
911/3/202311/2/2024
1011/20/202311/19/2024
119/28/20239/27/2024
129/29/20239/28/2024
139/30/20239/29/2024
149/14/20239/13/2024
Sheet1
Cell Formulas
RangeFormula
K5:K14K5=J5+365
J11J11= TODAY()+14-365
J12J12= TODAY()+15-365
J13J13= TODAY()+16-365
J14J14= TODAY()-365
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K5:K14Expression= $K5 - 15 = TODAY()textNO
 
Upvote 0
This should do it:
Excel Formula:
= $K5 - 15 = TODAY()

MrExcel_202409.xlsm
JK
4Last PerformedDATE DUE
511/24/202211/24/2023
611/8/202211/8/2023
712/25/202312/24/2024
811/6/202311/5/2024
911/3/202311/2/2024
1011/20/202311/19/2024
119/28/20239/27/2024
129/29/20239/28/2024
139/30/20239/29/2024
149/14/20239/13/2024
Sheet1
Cell Formulas
RangeFormula
K5:K14K5=J5+365
J11J11= TODAY()+14-365
J12J12= TODAY()+15-365
J13J13= TODAY()+16-365
J14J14= TODAY()-365
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K5:K14Expression= $K5 - 15 = TODAY()textNO
Do I need to enter all of the formulas into the rule manager for this to work?. When I enter = $K5 - 15 = TODAY() nothing changes. I also have a formula to highlight the overdue items using <TODAY(). I am unable to post the mini sheet.
 
Upvote 0
Do I need to enter all of the formulas into the rule manager for this to work?. When I enter = $K5 - 15 = TODAY() nothing changes. I also have a formula to highlight the overdue items using <TODAY(). I am unable to post the mini sheet.
In conditional formatting you should enter all the formulas necessary for the formatting to work.
Probably this is not what you wanted since this formula will only highlight cells where the date is exactly 15 days prior to the due date, no day(s) before, no day(s) after.

I don't know the logic of your workbook / worksheet. Is it something like a "live" dashboard (here my suggestion will do the job) or rather "static data" (no dynamic changes), like a simple (To-Do-) list.
Here you would need to adjust the formula a bit.
I think setting up a date range not a fixed date like "highlight all entries 15 prior to due date and beyond", but I may be wrong.

This is what I came up with:

MrExcel_202409.xlsm
JK
4Last PerformedDATE DUE
511/24/202211/24/2023
611/8/202211/8/2023
712/25/202312/24/2024
811/6/202311/5/2024
911/3/202311/2/2024
1011/20/202311/19/2024
119/28/20239/27/2024
129/29/20239/28/2024
139/30/20239/29/2024
149/14/20239/13/2024
Sheet1
Cell Formulas
RangeFormula
K5:K14K5=J5+365
J11J11= TODAY()+14-365
J12J12= TODAY()+15-365
J13J13= TODAY()+16-365
J14J14= TODAY()-365
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K5:K14Expression= $K5 - 15 < TODAY()textNO
K5:K14Expression= $K5 - 15 = TODAY()textNO


1726237133675.png


Let me know if that works or if anything should be changed otherwise.
 
Upvote 0
In conditional formatting you should enter all the formulas necessary for the formatting to work.
Probably this is not what you wanted since this formula will only highlight cells where the date is exactly 15 days prior to the due date, no day(s) before, no day(s) after.

I don't know the logic of your workbook / worksheet. Is it something like a "live" dashboard (here my suggestion will do the job) or rather "static data" (no dynamic changes), like a simple (To-Do-) list.
Here you would need to adjust the formula a bit.
I think setting up a date range not a fixed date like "highlight all entries 15 prior to due date and beyond", but I may be wrong.

This is what I came up with:

MrExcel_202409.xlsm
JK
4Last PerformedDATE DUE
511/24/202211/24/2023
611/8/202211/8/2023
712/25/202312/24/2024
811/6/202311/5/2024
911/3/202311/2/2024
1011/20/202311/19/2024
119/28/20239/27/2024
129/29/20239/28/2024
139/30/20239/29/2024
149/14/20239/13/2024
Sheet1
Cell Formulas
RangeFormula
K5:K14K5=J5+365
J11J11= TODAY()+14-365
J12J12= TODAY()+15-365
J13J13= TODAY()+16-365
J14J14= TODAY()-365
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K5:K14Expression= $K5 - 15 < TODAY()textNO
K5:K14Expression= $K5 - 15 = TODAY()textNO


View attachment 116821

Let me know if that works or if anything should be changed otherwise.
It seems to have worked, but it also changed the overdue items to the same format. How can I keep them seperate? The 15-day range will be orange and everything else older will be red.
 
Upvote 0
It seems to have worked, but it also changed the overdue items to the same format. How can I keep them seperate? The 15-day range will be orange and everything else older will be red.
Hmm, right now it's just guessing. I don't know your conditional formatting setup.

Would you mind sharing a screenshot of your Conditional Formatting?
 
Upvote 0

How did you actually manage to create this rule? I tried everything and couldn't get the same result.


What I can offer now is this:

MrExcel_202409.xlsm
JK
4Last PerformedDATE DUE
511/24/202211/24/2023
611/8/202211/8/2023
712/25/202312/24/2024
811/6/202311/5/2024
911/3/202311/2/2024
1011/20/202311/19/2024
119/28/20239/27/2024
129/29/20239/28/2024
139/30/20239/29/2024
149/14/20239/13/2024
Sheet1
Cell Formulas
RangeFormula
K5:K14K5=J5+365
J11J11= TODAY()+14-365
J12J12= TODAY()+15-365
J13J13= TODAY()+16-365
J14J14= TODAY()-365
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K5:K51Expression= $K5 - 15 < TODAY()textNO
K5:K51Expression= $K5 - 15 >= TODAY()textNO


Can you try it and tell me if it works?

_____________________________________
>>>>>>>>>>EDIT: 9/13/24 19:12
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,179
Members
452,615
Latest member
bogeys2birdies

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