Conditional format dates in a range which are x days from today

Sallyprit

New Member
Joined
Jan 25, 2024
Messages
13
Office Version
  1. 365
Platform
  1. Windows
I have a worksheet with peoples names in rows & courses they must take in columns.
The data in the intersecting cells shows the date when they are next required to take the course.
To assist with planning, I would like to be able to define a cell on the worksheet which I could enter how many days ahead I would like to look, 30/60/90 etc. I would like to conditional format those cells which are within the 30/60 or 90 day from today period. I can then filter under cell colour to make a list of these cells.

eg If I want to see dates up to 30 days from today tehn I would expect to see the cell with the red date highlighted.
If I wanted to see dates up to 90 days, I would expect to see the cells containing the red and green text highlighted.
If I wanted to see dates up to 365 days, I would also expect to see the cell containing the blue text.
courseClaireSoorajPaula
Autism eLearning02/01/2024No ExpiryNo Expiry
CarePlanningF2Ftraining21/11/2023
CareforOlderAdults31/01/2024No ExpiryNo Expiry
Dysphagia training17/01/202417/01/202406/08/2024
Team building27/03/202427/03/202417/08/2023
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Book1.xlsx
ABCD
1courseClaireSoorajPaula
2Autism eLearning1/2/2024No ExpiryNo Expiry
3CarePlanningF2Ftraining11/21/2023
4CareforOlderAdults1/31/2024No ExpiryNo Expiry
5Dysphagia training1/17/20241/17/20248/6/2024
6Team building3/27/20243/27/20248/17/2023
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:D6Expression=AND(B2-TODAY()<=30,B2-TODAY()>0)textNO
B2:D6Expression=AND(B2-TODAY()<=90,B2-TODAY()>30)textNO
B2:D6Expression=AND(B2-TODAY()<=365,B2-TODAY()>90)textNO


Book1.xlsx
ABCD
1period (days) =30
2
3courseClaireSoorajPaula
4Autism eLearning1/2/2024No ExpiryNo Expiry
5CarePlanningF2Ftraining11/21/2023
6CareforOlderAdults1/31/2024No ExpiryNo Expiry
7Dysphagia training1/17/20241/17/20248/6/2024
8Team building3/27/20243/27/20248/17/2023
Sheet3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B4:D8Expression= IF(AND($B$1>0,$B$1<=30),AND(B4-TODAY()<=30,B4-TODAY()>0))textNO
B4:D8Expression= IF(AND($B$1>30,$B$1<=90),AND(B4-TODAY()<=90,B4-TODAY()>30))textNO
B4:D8Expression= IF(AND($B$1>90,$B$1<=365),AND(B4-TODAY()<=365,B4-TODAY()>90))textNO
 
Upvote 0
Solution
Book1.xlsx
ABCD
1courseClaireSoorajPaula
2Autism eLearning1/2/2024No ExpiryNo Expiry
3CarePlanningF2Ftraining11/21/2023
4CareforOlderAdults1/31/2024No ExpiryNo Expiry
5Dysphagia training1/17/20241/17/20248/6/2024
6Team building3/27/20243/27/20248/17/2023
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:D6Expression=AND(B2-TODAY()<=30,B2-TODAY()>0)textNO
B2:D6Expression=AND(B2-TODAY()<=90,B2-TODAY()>30)textNO
B2:D6Expression=AND(B2-TODAY()<=365,B2-TODAY()>90)textNO


Book1.xlsx
ABCD
1period (days) =30
2
3courseClaireSoorajPaula
4Autism eLearning1/2/2024No ExpiryNo Expiry
5CarePlanningF2Ftraining11/21/2023
6CareforOlderAdults1/31/2024No ExpiryNo Expiry
7Dysphagia training1/17/20241/17/20248/6/2024
8Team building3/27/20243/27/20248/17/2023
Sheet3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B4:D8Expression= IF(AND($B$1>0,$B$1<=30),AND(B4-TODAY()<=30,B4-TODAY()>0))textNO
B4:D8Expression= IF(AND($B$1>30,$B$1<=90),AND(B4-TODAY()<=90,B4-TODAY()>30))textNO
B4:D8Expression= IF(AND($B$1>90,$B$1<=365),AND(B4-TODAY()<=365,B4-TODAY()>90))textNO
Hi Pete
I have been working with this now & works beautifully. I would now like to see any dates highlighted a different colour where the date in the cell is in the past. Please advise what the condition would be for this.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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