+ Reply to Thread
Results 1 to 5 of 5

Exclude weekends in date counting

  1. #1
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Exclude weekends in date counting

    Hi guys,

    I have been trying to count dates in my spreadsheet. The dates are supposed to go back in time (what they do). But I want them to jump over the weekends' dates instead of landing on them.

    What I have is Start Date, Req'd Qty, Days it takes to make, Date it is required to start production (which I have a problem with).

    A
    1 26-Nov [Thursday]
    2 1500
    3 5
    4 'Problem' I used for this cell that formula: =if(A2>0,A1-A3,"") , as I don't want it to show anything if there is no requirements.

    It comes back with 21-Nov which is Saturday when I want it to come back with 19-Nov (Thursday) as we only have 5 working days in a week.

    If anybody has an idea how to go around those weekend days please help, as it would help me a lot.

    Thanks for reading and suggesting.

    I also attached a little test file.
    Attached Files Attached Files
    Last edited by Ramzes; 12-10-2009 at 08:58 AM.

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

    Re: Exluding weekend's in date counting formula

    You can make use of WORKDAY (see Note at foot of post)

    =IF(A2>0,WORKDAY(A1,-A3,holidays),"")

    where holidays is a named range containing a list of public holidays to be excluded also - this is optional so remove that in red if not required.

    adjust also the day offset by 1 (-(A3)+1) if you wish start date to be inclusive in the calculation (and assuming of course A1 is a workday!)

    NOTE: pre XL07 you need to activate the Analysis ToolPak to make use of WORKDAY (else you will received #NAME? error)
    Last edited by DonkeyOte; 12-09-2009 at 09:31 AM. Reason: reworded

  3. #3
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: Exluding weekend's in date counting formula

    Hi DonkeyOte,

    Thanks for your help. I have tried your suggestion.:


    Quote Originally Posted by DonkeyOte View Post
    =IF(A2>0,WORKDAY(A1,-A3,holidays),"")
    Didn't work - Returning #NAME?. I didin't include any holidays if it could cause a problem
    Quote Originally Posted by DonkeyOte View Post
    NOTE: pre XL07 you need to activate the Analysis ToolPak to make use of WORKDAY (else you will received #NAME? error)
    Is it because pre XL07 means Excel version lower than 2007? If so how can I activate that toolpak, as I cannot find it in options.

    If you can respond to this it would be brilliant.

    Thanks anyway.
    Last edited by Ramzes; 12-09-2009 at 12:30 PM. Reason: reworded

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

    Re: Exclude weekends in date counting

    To activate the Add-in go to Tools -> Add-Ins and "check" Analysis ToolPak

    Re: holidays - yes if you don't have a range then remove the text in red from your formula, ie:

    =IF(A2>0,WORKDAY(A1,-A3),"")

  5. #5
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: Exclude weekends in date counting

    I did took out the ",holidays" part from the formula because I didin't crate that range. I'm sorry for the confusion, when I quoted. It didn't work because I didn't have that add-in installed. Now it is sorted and the formula works perfectly.

    Thanks for your help DonKeyOte. This is a massive improvement to my spreadsheet

+ 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