+ Reply to Thread
Results 1 to 3 of 3

Date Shift Formula Requirement

  1. #1
    Registered User
    Join Date
    09-12-2007
    Location
    UK, Reading.
    MS-Off Ver
    All 2003
    Posts
    14

    Date Shift Formula Requirement

    Hi

    If possible I’d like some assistance with the following please.

    We have some data which contains dates in a 1st single column.

    The result is to be in the 2nd column.

    The requirement are:

    - When the date is a weekday we don’t need to do anything, the result in the 2nd column is the same date.

    - When the date is a Saturday or Sunday the result required is the date of the following Monday.

    The following I hope describes the requirements:

    Starting Date in 1st column

    Resulting Date in 2nd column

    13/07/09 13/07/09 Weekday dates remain unchanged but formula still in cells
    14/07/09 14/07/09
    15/07/09 15/07/09
    16/07/09 16/07/09
    17/07/09 17/07/09
    18/07/09 20/07/09 Saturday's date is "jogged" to the following Monday
    19/07/09 20/07/09 Sunday's date is "jogged" to the following Monday
    20/07/09 20/07/09
    21/07/09 21/07/09

    So far my efforts don’t extend beyond a formula which is working just for a Saturday or a Sunday and these are returning an invalid result when the day is a weekday, I’d like a single formula to do this.

    Please send your responses where possible.

    Many thanks in advance.



    Henry.

    ..............................................................
    Henry Thompson
    Resource Planning Officer, Programme Management Office
    The National Strategies
    Last edited by henrythompson; 07-08-2009 at 05:08 AM. Reason: Layout and clarity

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Date Shift Formula Requirement

    One way:

    B1: =A1+LOOKUP(WEEKDAY(A1,2),{1,6,7},{0,2,1})

    Another way - making use of the Analysis ToolPak (activated via Tools - Addins)

    B1: =WORKDAY(A1-1,1)

    WORKDAY has the added advantage of being very flexible, and like NETWORKDAYs it has an optional argument for a range of public holidays to be excluded alongside the weekends.

  3. #3
    Registered User
    Join Date
    09-12-2007
    Location
    UK, Reading.
    MS-Off Ver
    All 2003
    Posts
    14

    Thumbs up Re: Date Shift Formula Requirement

    Hi DonkeyOte

    That's brilliant, many thanks for the prompt and precise answers to my problem.

    Cheers.

    Henry.

+ 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