Conditional formatting for number of weeks passed

CaptainGravyBum

Board Regular
Joined
Dec 1, 2023
Messages
82
Office Version
  1. 365
Platform
  1. Windows
Hello,
I need to add conditional formatting for column D on my sheet when the date entered was ten weeks prior to the current date. Columns A:C are slightly different in that the highlight needs to happen when the date shown is three months away or less.
There are many posts about conditional formatting, but I can't get them working correctly, not sure if it's because they are day based or the formula I've been using is just formatted wrong.
I've ditched the formula's in the sheet for now, so it's a clean slate if anyone can help.
Thanks.

Book5.xlsx
ABCD
115.12.202715.12.202719.12.202703.01.2024
201.03.202803.03.202810.02.202803.01.2025
309.03.202710.03.202729.03.202703.01.2025
Sheet1
 

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.
edit = posted at same time

those are not dates - BUT text
whch maybe the reason you have an issue
 
Upvote 0
I've managed to get a bit further along now the formatting is correct, but it still isn't correct.
D1 has highlighted but it isn't 10 weeks from now and I will need dates that are already passed to be in red. I'm not entirely sure what A:C are doing, they should highlight when todays date is 3 months or less from the date provided and if the date shown has already passed they need to be in red.
Sorry to dump all this over, no doubt the solution is obvious, I just can't see it.
I can't post my sheet here, I'll try again in another reply.
 
Upvote 0
10 weeks Prior is that in future
so that 10*7 = 70days


what column are you comparing the date ON - or all 4

for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
A1:D10000 - Change, reduce or extend the rows to meet your data range of rows

Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:
=AND(A1 <> "" , A1<TODAY())

Format [Number, Font, Border, Fill]
choose the format you would like to apply when the condition is true
OK >> OK

Thats RED

Next is less than 3months

=AND(A1 <> "" , A1<date(Year(TODAY()),Month(today()),day(today())+70)

ensure the 1rst rule RED is at the TOP of the LIST and stop if true
otherwise you need another AND condition

=AND(A1 <> "" , A1<date(Year(TODAY()),Month(today()),day(today())+70), A1>=today() )
Book1
ABCD
112/15/2712/15/2712/19/271/3/24
23/1/283/3/282/10/281/3/25
33/9/273/10/273/29/271/3/25
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:D3Expression=AND(A1 <> "", A1<TODAY())textYES
A1:D3Expression=AND(A1 <> "", A1<DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())+70), A1>=TODAY() )textYES
 
Last edited:
Upvote 0
you are welcome
if you want 3 months rather than 70days, then use +3 on the months

=AND(A1 <> "", A1<DATE(YEAR(TODAY()),MONTH(TODAY())+3,DAY(TODAY())), A1>=TODAY() )
 
Upvote 0

Forum statistics

Threads
1,225,319
Messages
6,184,261
Members
453,223
Latest member
Ignition04

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