+ Reply to Thread
Results 1 to 7 of 7

Date related problem concerning weekends

Hybrid View

  1. #1
    Registered User
    Join Date
    12-20-2006
    Posts
    34

    Date related problem concerning weekends

    Hi All,

    Hope someone can help.
    I have a date related problem and it goes like this:-
    Within any working week a TRD (target ready date) is set by customer services.
    Depending on the product selected (21;22;23;24) each has a lead time respectively of (2days;5days;7days and 9days)
    Initially I thought it would be simple enough to take the TRD and subtract 2 days from it which would then give me a start date.
    This works quite well until you realise that the new start date could fall on a Saturday or Sunday which I can't allow to happen.

    What I require is a formula that looks at the product code and then subtracts the equivalent amount of days from the TRD and also takes into account weekends. If a weekend falls within thes period, then I would like the start date to be on the Friday.

    Regards

    Bodz

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

    Re: Date related problem concerning weekends

    You don't specify your XL Version in your profile but I would suggest reviewing the WORKDAY Function... pre XL2007 this requires activation of the Analysis ToolPak (via Tools -> Add-Ins menu).

  3. #3
    Registered User
    Join Date
    12-20-2006
    Posts
    34

    Re: Date related problem concerning weekends

    Hi DonkeyOte,

    XL version is 2003.
    I've not worked with WORKDAY function before - any tips.
    So far, I've been trying to use the NETWORKDAYS function.

    Bodz

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

    Re: Date related problem concerning weekends

    WORKDAY like NETWORKDAYS by default ignores weekends when calculating and has optional public holidays parameter which is obviously important in these scenarios... the basic premise ?

    =WORKDAY(date,adjustment,[holidays])
    the adjustment can be negative... so in your case

    =WORKDAY(A1,LOOKUP(B1,{21,22,23,24},{-2,-5,-7,-9}),_holidays)
    where:

    A1: cell containing TR Date
    B1: Product code (21-24)
    _holidays: named range containing the public holiday dates to be ignored in addition to weekends.
    you can adjust the adjustment array to account for whether or not current TRDate itself is inclusive of lead time (ie -2 becomes -1 etc...) ... we're also assuming that the target delivery date is always a valid workday.
    Last edited by DonkeyOte; 09-16-2009 at 10:51 AM. Reason: added note re: delivery date being valid

  5. #5
    Registered User
    Join Date
    12-20-2006
    Posts
    34

    Re: Date related problem concerning weekends

    Hi DonkeyOte,

    Thanks for the reply. Sorry I didn't get back earlier.
    I had a ply withthe function and you were right. It was the missing bit that I needed to make the rest work.

    Thanks for your help.

    Bodz

  6. #6
    Registered User
    Join Date
    12-20-2006
    Posts
    34

    Re: Date related problem concerning weekends

    Now that the problem is solved I need to mark it as such but am having a bit of a problem finding where to go in order to do this.

    Bodz

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

    Re: Date related problem concerning weekends

    see FAQ / How To ?

+ 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