+ Reply to Thread
Results 1 to 15 of 15

WORKDAY function

  1. #1
    Registered User
    Join Date
    06-11-2009
    Location
    HK
    MS-Off Ver
    Excel 2003
    Posts
    7

    WORKDAY function

    As everyone realizes that WORKDAY function can return a working date that exclude weekends and any dates identified as holidays. However, what if I want to return a working date excluding my designated holidays but including weekends?

    For example,

    Holidays are 1 Jun 2009, 2 Jun 2009 and 4 Jun 2009

    Start Date: ???
    Finish Date: 8 Jun 2009
    Duration: 5 days

    The Start Date should be 30 May 2009.

    Seems like I am not able to use WORKDAY function to calculate the start date...any idea? Thanks for great help in advance

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: WORKDAY function

    Please take a few minutes to read the forum rules.

    We don't do URGENT. If your need is urgent, please post in the commercial services forum.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-11-2009
    Location
    HK
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: WORKDAY function

    Alright. Got it.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: WORKDAY function

    This formula is from Bob Phillips:

    =daStart + IF(nDays=0, 0, SIGN(nDays) * SMALL(IF(ISNA(MATCH(daStart + SIGN(nDays) * (ROW(INDIRECT("1:" & ABS(nDays) * 10) ) ), Holidays, 0) ), ROW(INDIRECT("1:" & ABS(nDays) * 10) ) ), ABS(nDays ) ) )

    It's an array formula, which means it MUST be confirmed with Ctrl+Shift+Enter, not just Enter.

  5. #5
    Registered User
    Join Date
    06-11-2009
    Location
    HK
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: WORKDAY function

    Hi Shg, thanks for your reply. It works fine. Do you mind simply explaining this formula?

  6. #6
    Registered User
    Join Date
    06-11-2009
    Location
    HK
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: WORKDAY function

    Does anyone know why below error is causing error?

    Using the formula in BLUE is working fine. I would like to blank out the cell if A4 or B4 is blank. Is there any alternative way to get around?


    =IF(OR($A4="",$B4=""),"",AO4+IF(H4=0,0,SIGN(H4)*SMALL(IF(ISNA(MATCH(AP4+SIGN(H4)*(ROW(INDIRECT("1:"&ABS(H4)*10))),INDIRECT(E4),0)),ROW(INDIRECT("1:"&ABS(H4)*10))),ABS(H4))))

  7. #7
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: WORKDAY function

    Did you remember to press CTRL+SHIFT+ENTER after adding the new formula section? It's still an array formula, so you need to do that.

  8. #8
    Registered User
    Join Date
    06-11-2009
    Location
    HK
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: WORKDAY function

    Hi Paul, thanks for the quick response. I did.

    Running "=AO4+IF(H4=0,0,SIGN(H4)*SMALL(IF(ISNA(MATCH(AP4+SIGN(H4)*(ROW(INDIRECT("1:"&ABS(H4)*10))),INDIRECT(E4 ),0)),ROW(INDIRECT("1:"&ABS(H4)*10))),ABS(H4)))) " with CTRL+SHIFT+ENTER is fine.

    But I would like to blank out this cell if cell A4 or B4 is blank, what should I do?

  9. #9
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: WORKDAY function

    Your updated formula should work just fine.
    Please Login or Register  to view this content.
    After typing it, just press CTRL+SHIFT+ENTER. Adding the check for blanks shouldn't generate an error if the rest of the formula has remained the same. I don't have any data, but on my sheet it returns blank until I put something into A4 and B4, at which point it returns 0.

  10. #10
    Registered User
    Join Date
    06-11-2009
    Location
    HK
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: WORKDAY function

    I have attached my excel file for your reference

    Take a look at the AN4 cell, it doesn' work with "=IF(OR($A4="",$B4=""),"",AO4+IF(H4=0,0,SIGN(H4)*SMALL(IF(ISNA(MATCH(AP4+SIGN(H4)*(ROW(INDIRECT("1:"&ABS(H4)*10))),INDIRECT(E4),0)),ROW(INDIRECT("1:"&ABS(H4)*10))),ABS(H4))))".

    By the way I am using excel 2003. Thanks for help in advance.
    Attached Files Attached Files

  11. #11
    Valued Forum Contributor squiggler47's Avatar
    Join Date
    02-17-2009
    Location
    Littleborough, UK
    MS-Off Ver
    Excel 3.0 to 2007+2010! (couldnt get 2.1 working)
    Posts
    1,013

    Re: WORKDAY function

    probably a silly question but wouldn't it just be easier to subtract the number of days then check how many holidays fall between the 2 dates calculated and subtract them, since weekends arent a problem?
    Regards
    Darren

    Update 12-Nov-2010 Still job hunting!

    If you are happy with the results, please add to our reputation by clicking the blue scales icon in the blue bar of the post.

    Learn something new each day, Embrace change do not fear it, evolve and do not become extinct!


  12. #12
    Registered User
    Join Date
    06-11-2009
    Location
    HK
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: WORKDAY function

    This way doesn't work. The calculated start date may fall into the holiday list.

  13. #13
    Registered User
    Join Date
    06-11-2010
    Location
    Ghent, Belgium
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: WORKDAY function

    Hello,

    I have a similar problem and reading above replies, I think someone of you can help me. I would very much appreciate it if you would take a look at question below.

    The workday function can return the end date based on start date and duration, excluding weekends. However, I want to calculate start date based on end date and duration also weekends.

    For example=

    Start Date: ?
    Finish Date: 27 Jul 2010
    Duration: 3 days

    The Start Date should be 24 July 2010

    Many thanks in advance for your help!

    Regards,

    Kaatje

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

    Re: WORKDAY function

    Please ask questions in your own thread - not the thread of another member.

    edit: as you have done since posting above

  15. #15
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: WORKDAY function

    Quote Originally Posted by squiggler47 View Post
    probably a silly question but wouldn't it just be easier to subtract the number of days then check how many holidays fall between the 2 dates calculated and subtract them, since weekends arent a problem?
    But what if one of thos holidays is between the originally calculated end date and then the adjusted end date. You would then need to calculate how many of those days are in the holday list, and add them back in. Then you have to do it all again , and again, and again, and ...

+ 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