Forum Discussion
Conditional Formatting for Date Occurring 2 Weeks (not days) in the Future
- Feb 23, 2020
- SWB_MTCFeb 25, 2020Copper Contributor
Patrick2788Thanks much for this! It *almost* works. I added the formula four times exactly as you typed it, substituting 1 thru 4 for X to shade the next 4 weeks.
=WEEKNUM($A2)=WEEKNUM(TODAY())+1
=WEEKNUM($A2)=WEEKNUM(TODAY())+2
=WEEKNUM($A2)=WEEKNUM(TODAY())+3
=WEEKNUM($A2)=WEEKNUM(TODAY())+4So today is 02-25-20 (for those reading the post in the future). The new formulas shade in variants of gray that increase with each week for the next 1-4 weeks. I've attached a picture of what the result is. Sort of weird that the formula(s) see the same date, 03-12-20, in two different weeks: Week 2 and Week 3. Thanks again for your help. I think your formula may be the answer, but something needs to be tweaked; I'm just not sure what.
Ideally, the dates would be shaded in variant shades of gray as follows (weekend days won't appear as they are not used in this application). NOTE: Red is last week and Peach is this week (those were already done with the conditional formatting options provided by excel).
Week 1: 03-02 thru 03-06
Week 2: 03-09 thru 03-13
Week 3: 03-16 thru 03-20
Week 4: 03-23 thru 03-27
Thanks again!
- MSM182Jan 30, 2021Copper Contributor
SWB_MTC I tried your exact formula, and when I enter a date in a cell, the cell above it gets highlighted, not the cell I need. What is the cause of that?
Do I need to change "A2" to which column my cell is on, for example "M"?
- SWB_MTCJan 30, 2021Copper Contributor
MSM182 Correct. You have to use the Column letter for the specific column you're working in. I've attached a copy of the original spreadsheet that @Patrick2788 was so kind to create for me and I added my own Column for you to see examples of Conditional Formatting with an Excel provided template date (like Today and Next Week) along with following weeks using the formula @Patrick2788 provided. My column has Today, Next Week, and then Weeks 2-8 in the future. I included a Color Legend because that's helpful to see at-a-glance. NOTE: @Patrick2788 provided a cell range in his example for the "Applies to" area. However, I used the entire Column (in my case "=$D:$D") in the "Applies to" area. Another difference: His formula references A2, which has a date entered. Conversely, my formula references D1, which is just text. This proves that you don't necessarily have to have a Date entered in your reference cell. It works both ways.
- Patrick2788Feb 25, 2020Silver Contributor
- SWB_MTCFeb 25, 2020Copper Contributor
Patrick2788 Thanks again! So on a hunch, I checked out the order of my formulas. I had added Week 4's formula *prior* to Week 3's formula which made Week 3 the last in the list and forgot to reorder them in correct order (Week 1, Week 2, Week 3, Week 4). After I reordered the formulas, it worked like a charm, so apparently the order makes a difference. Thank you so much!!! It makes me sad that when one contacts the sanctioned Microsoft Excel Support Experts for a paid account via the Chat Tool, you're told it can't be done. I *knew* it had to be possible as I couldn't have been the only person on the planet that needed to see dates in the future in relation to how many weeks out they are. Much respect to you @Patrick2788!