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
 
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
It now displays the 2 formats but the 15 day one does not seem to be correct, some of the dates are not due until the end of the year or next year
1726254688022.png
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I made another table with the data you have shown and it all seems right:

MrExcel_202409.xlsm
IJKLM
4Maint. Freq.Last PerformedDATE DUEdelta15d ?
51 year11/24/202211/24/2023295TRUE
61 year11/8/202211/8/2023311TRUE
71 year12/25/202312/24/2024-101FALSE
81 year11/6/202311/5/2024-52FALSE
91 year11/3/202311/2/2024-49FALSE
101 year11/20/202311/19/2024-66FALSE
111 year9/29/20239/28/2024-14TRUE
121 year9/30/20239/29/2024-15FALSE
131 year10/1/20239/30/2024-16FALSE
141 year9/15/20239/14/20240TRUE
15
16
17
18
19
20Maint. Freq.Last PerformedDATE DUEdelta15d ?
211 year1/13/20231/13/2024245TRUE
221 year12/22/202312/21/2024-98FALSE
231 year11/15/202311/14/2024-61FALSE
241 year12/25/202312/24/2024-101FALSE
251 year1/15/20241/14/2025-122FALSE
261 year1/25/20241/24/2025-132FALSE
271 year1/25/20241/24/2025-132FALSE
281 year10/31/202310/30/2024-46FALSE
291 year10/10/202210/10/2023340TRUE
301 year10/11/202210/11/2023339TRUE
311 year11/8/202211/8/2023311TRUE
321 year2/3/20232/3/2024224TRUE
332 years11/13/202311/12/2025-424FALSE
341 year9/10/20249/10/2025-361FALSE
351 year9/12/20239/11/20243TRUE
361 year11/4/202211/4/2023315TRUE
371 year5/3/20235/2/2024135TRUE
382 years9/10/20249/10/2026-726FALSE
39
401 year9/10/20249/10/2025-361FALSE
411 year1/12/20241/11/2025-119FALSE
Sheet1
Cell Formulas
RangeFormula
K40:K41,K21:K38,K5:K14K5= J5 + 365 * I5
L40:L41,L21:L38,L5:L14L5= TODAY() - K5
M40:M41,M21:M38,M5:M14M5= L5 > -15
J11J11= TODAY()+14-365
J12J12= TODAY()+15-365
J13J13= TODAY()+16-365
J14J14= TODAY()-365
Cells with Conditional Formatting
CellConditionCell FormatStop If True
M5:M50Cell Valuecontains "FALSE"textNO
M5:M50Cell Valuecontains "TRUE"textNO
K5:K50Expression= $K5 - 15 < TODAY()textNO
K5:K50Expression= $K5 - 15 >= TODAY()textNO


Could you please point out the wrong results?
 
Upvote 0
I made another table with the data you have shown and it all seems right:

MrExcel_202409.xlsm
IJKLM
4Maint. Freq.Last PerformedDATE DUEdelta15d ?
51 year11/24/202211/24/2023295TRUE
61 year11/8/202211/8/2023311TRUE
71 year12/25/202312/24/2024-101FALSE
81 year11/6/202311/5/2024-52FALSE
91 year11/3/202311/2/2024-49FALSE
101 year11/20/202311/19/2024-66FALSE
111 year9/29/20239/28/2024-14TRUE
121 year9/30/20239/29/2024-15FALSE
131 year10/1/20239/30/2024-16FALSE
141 year9/15/20239/14/20240TRUE
15
16
17
18
19
20Maint. Freq.Last PerformedDATE DUEdelta15d ?
211 year1/13/20231/13/2024245TRUE
221 year12/22/202312/21/2024-98FALSE
231 year11/15/202311/14/2024-61FALSE
241 year12/25/202312/24/2024-101FALSE
251 year1/15/20241/14/2025-122FALSE
261 year1/25/20241/24/2025-132FALSE
271 year1/25/20241/24/2025-132FALSE
281 year10/31/202310/30/2024-46FALSE
291 year10/10/202210/10/2023340TRUE
301 year10/11/202210/11/2023339TRUE
311 year11/8/202211/8/2023311TRUE
321 year2/3/20232/3/2024224TRUE
332 years11/13/202311/12/2025-424FALSE
341 year9/10/20249/10/2025-361FALSE
351 year9/12/20239/11/20243TRUE
361 year11/4/202211/4/2023315TRUE
371 year5/3/20235/2/2024135TRUE
382 years9/10/20249/10/2026-726FALSE
39
401 year9/10/20249/10/2025-361FALSE
411 year1/12/20241/11/2025-119FALSE
Sheet1
Cell Formulas
RangeFormula
K40:K41,K21:K38,K5:K14K5= J5 + 365 * I5
L40:L41,L21:L38,L5:L14L5= TODAY() - K5
M40:M41,M21:M38,M5:M14M5= L5 > -15
J11J11= TODAY()+14-365
J12J12= TODAY()+15-365
J13J13= TODAY()+16-365
J14J14= TODAY()-365
Cells with Conditional Formatting
CellConditionCell FormatStop If True
M5:M50Cell Valuecontains "FALSE"textNO
M5:M50Cell Valuecontains "TRUE"textNO
K5:K50Expression= $K5 - 15 < TODAY()textNO
K5:K50Expression= $K5 - 15 >= TODAY()textNO


Could you please point out the wrong results?
The items highlighted in orange should remain black (or unformatted) until they are within 15 days of the Due Date.
 
Upvote 0
The items highlighted in orange should remain black (or unformatted) until they are within 15 days of the Due Date.
I made another table with the data you have shown and it all seems right:

MrExcel_202409.xlsm
IJKLM
4Maint. Freq.Last PerformedDATE DUEdelta15d ?
51 year11/24/202211/24/2023295TRUE
61 year11/8/202211/8/2023311TRUE
71 year12/25/202312/24/2024-101FALSE
81 year11/6/202311/5/2024-52FALSE
91 year11/3/202311/2/2024-49FALSE
101 year11/20/202311/19/2024-66FALSE
111 year9/29/20239/28/2024-14TRUE
121 year9/30/20239/29/2024-15FALSE
131 year10/1/20239/30/2024-16FALSE
141 year9/15/20239/14/20240TRUE
15
16
17
18
19
20Maint. Freq.Last PerformedDATE DUEdelta15d ?
211 year1/13/20231/13/2024245TRUE
221 year12/22/202312/21/2024-98FALSE
231 year11/15/202311/14/2024-61FALSE
241 year12/25/202312/24/2024-101FALSE
251 year1/15/20241/14/2025-122FALSE
261 year1/25/20241/24/2025-132FALSE
271 year1/25/20241/24/2025-132FALSE
281 year10/31/202310/30/2024-46FALSE
291 year10/10/202210/10/2023340TRUE
301 year10/11/202210/11/2023339TRUE
311 year11/8/202211/8/2023311TRUE
321 year2/3/20232/3/2024224TRUE
332 years11/13/202311/12/2025-424FALSE
341 year9/10/20249/10/2025-361FALSE
351 year9/12/20239/11/20243TRUE
361 year11/4/202211/4/2023315TRUE
371 year5/3/20235/2/2024135TRUE
382 years9/10/20249/10/2026-726FALSE
39
401 year9/10/20249/10/2025-361FALSE
411 year1/12/20241/11/2025-119FALSE
Sheet1
Cell Formulas
RangeFormula
K40:K41,K21:K38,K5:K14K5= J5 + 365 * I5
L40:L41,L21:L38,L5:L14L5= TODAY() - K5
M40:M41,M21:M38,M5:M14M5= L5 > -15
J11J11= TODAY()+14-365
J12J12= TODAY()+15-365
J13J13= TODAY()+16-365
J14J14= TODAY()-365
Cells with Conditional Formatting
CellConditionCell FormatStop If True
M5:M50Cell Valuecontains "FALSE"textNO
M5:M50Cell Valuecontains "TRUE"textNO
K5:K50Expression= $K5 - 15 < TODAY()textNO
K5:K50Expression= $K5 - 15 >= TODAY()textNO


Could you please point out the wrong results?
When I use = TODAY()+15-365 it highlights everything in orange. Am I doing something wrong on my end? I feel like I'm missing something. Which formula should I be using?
 
Upvote 0
When I use = TODAY()+15-365 it highlights everything in orange. Am I doing something wrong on my end? I feel like I'm missing something. Which formula should I be using?
Oh, you shouldn't use that formula at all! I made it just for testing the conditional formatting. Sorry for the confusion.

J11J11= TODAY()+14-365
J12J12= TODAY()+15-365
J13J13= TODAY()+16-365
J14J14= TODAY()-365

Those formulas simply generate dates for testing the 15 day range.

Please remove those formulas and let me know if things work after that.
 
Upvote 0
Oh, you shouldn't use that formula at all! I made it just for testing the conditional formatting. Sorry for the confusion.

J11J11= TODAY()+14-365
J12J12= TODAY()+15-365
J13J13= TODAY()+16-365
J14J14= TODAY()-365

Those formulas simply generate dates for testing the 15 day range.

Please remove those formulas and let me know if things work after that.
If I remove that formula all I have left is what I'm using to format the dates that are older than todays date. How would the 15 day conditional format work? I'm lost...LOL
 

Attachments

  • 1726575313535.png
    1726575313535.png
    16.9 KB · Views: 3
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

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