+ Reply to Thread
Results 1 to 11 of 11

Highlight Only Current Week Based on Date

  1. #1
    Forum Contributor
    Join Date
    08-19-2006
    MS-Off Ver
    Excel 365
    Posts
    229

    Highlight Only Current Week Based on Date

    Hi,

    I have the table as attached.

    The dates in row 3 represents the start date for the particular week of the month. I would like only the current week in row 4 to be highlighted based on the current date.

    Example: If the current date is Nov 14 2010, then only cell C4 should be highlighted.


    Is there a formula I could use in conditional formatting ?

    I am using Excel 2007.

    I have a cross post here:

    http://www.mrexcel.com/forum/showthread.php?t=508924
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Highlight Only Current Week Based on Date

    The condition in B4 (and copy across) is:

    =AND(TODAY()>=B$3,TODAY()<=B$3+7) ... format as required


    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Highlight Only Current Week Based on Date

    1. Select range B4:F4 and go to Format > Conditional Formatting.

    2. Enter as Formula is:

    Please Login or Register  to view this content.
    and set font/colours as required.

    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  4. #4
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Highlight Only Current Week Based on Date

    Connexion,

    as Now() returns Date AND Time, it could yield uncorrect results depending on the hour the sheet is opened. TODAY is the way to go

  5. #5
    Forum Contributor
    Join Date
    08-19-2006
    MS-Off Ver
    Excel 365
    Posts
    229

    Re: Highlight Only Current Week Based on Date

    Hi arthurbr/TMShucks/ConneXionLost

    Thank you for your solutions and tips.

    TMShucks - Your solution worked perfectly !

    I have an additional requirement that I just realize needs to be incorporated.

    Is it possible to modify the formula for conditional formatting to include a border around the column for the current week as attached ?

    Appreciate your assistance and thank you in advance for your patience.
    Attached Files Attached Files

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Highlight Only Current Week Based on Date

    Yes, just select the borders tab when you are choosing your formatting options and add a border. You can click on any or all of the tabs and choose whatever options you need.

    Regards

  7. #7
    Forum Contributor
    Join Date
    08-19-2006
    MS-Off Ver
    Excel 365
    Posts
    229

    Re: Highlight Only Current Week Based on Date

    Hi TMShucks,

    I did as instructed but it does not seems to be working. I have the attached the file here for your review.

    Appreciate your assistance and thank you for your patience.
    Attached Files Attached Files

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Highlight Only Current Week Based on Date

    working ok when i look d4 is high-lighted as today is 17th and is in week beginning 15/11/2010
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  9. #9
    Forum Contributor
    Join Date
    08-19-2006
    MS-Off Ver
    Excel 365
    Posts
    229

    Re: Highlight Only Current Week Based on Date

    Hi Martin,

    Yes, that part is working fine.

    However, I would like the border of the column for the current week to be highlighted as well. In this case, the border for the column from d5 to d21 to be highlighted.

    Appreciate your assistance.

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Highlight Only Current Week Based on Date

    well perhaps like this i have only 97 at the moment you may get more options with 2007
    Attached Files Attached Files

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Highlight Only Current Week Based on Date

    See attached


    Regards
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1