• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How do you conditionally format a range of cells based upon two date related scenarios?

kemneric

New Member
First, and probably easier scenario: how do you (or can you) compare a date (TODAY) to a given month to see if it falls within that month, other than by using the pre-formatted 'A Date Occurring' formulas. Because the 'A date occurring' formulas only apply to the value of the specific cell. I want to apply a comparison of the current date to several dates and highlight them all accordingly (similar way of accomplishing what I am doing below with weeks...).

Second, scenario: see attached image. In this case I am trying to format based upon a comparison of a specified value (the TODAY value in the upper left - highlighted bright yellow) to a date. In the formulas the dates make a 'weekly' range by comparing to a +7 value from the start of the given week. I want to format the entire column based upon whether the TODAY is in the past, the current week, or the future as compared to the date at the top of the column. This would create a 'moving' current week highlight that would progress ands TODAY advances. As you can see the formatting seems to work for the cell that contains the date value, but not for the rest of the cells in its column. I don't know why all of the cells beneath the date value are brown...
 

Attachments

  • upload_2013-12-9_17-43-24.png
    upload_2013-12-9_17-43-24.png
    673.2 KB · Views: 14
  • excel-help-1.jpg
    excel-help-1.jpg
    77.7 KB · Views: 13
Hi kemneric,

Could not read your attachments, but look at attached file for the first question.

cheers

kanti
 
Hi kemneric,

Please see the attached file Sheet 2. I had use
=WEEKNUM($B$1)=WEEKNUM(A$3) formula to highlight colunm in yellow if today (B1) is falling in week starting with dates in (A3). For past and present I had use < and > within the same formula.

But here we had a limititation, when the year will change week number will again starts from 1. So equal to criteria will meet, but you may get some false CF with less than or greater than CF.

See if this of any use!

And secondly to CF a cell with month queals to todays date month you can use @kchiba formula. You can see his formula in my file sheet 1.

Regards!
 

Attachments

  • DateFormat(1).xlsx
    11.3 KB · Views: 5
Thank you both for such quick replies.

Somendra, your solution works very well, but have you found any way to overcome the year change limitation? I'm trying to set-up a template, so the dates will often have a year change
 
@kemneric
Hi !
Please have a look at attached file. I had introduced a new formula for future years.
=YEAR(A$3)&WEEKNUM(A$3)>YEAR($B$1)&WEEKNUM($B$1)
It has the same formating colour as for the future weeknum.

Just advise if this is ok and meeting your criteria.

Regards!
 

Attachments

  • DateFormat(1)(1).xlsx
    11.5 KB · Views: 4
Back
Top