+ Reply to Thread
Results 1 to 14 of 14

Workday formula not skipping weekend

  1. #1
    Registered User
    Join Date
    02-05-2009
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    30

    Workday formula not skipping weekend

    The Workday formula was working great until D23 where it failed to skip the weekend. It is the same formula for the entire column D, can't figure out why it stopped working.

    Thanks in advance for the help!

    Dale
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    30,525

    Re: Workday formula not skipping weekend

    What is wrong? What results are you expecting?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Registered User
    Join Date
    02-05-2009
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Workday formula not skipping weekend

    The formula is in every cell of Column D. D23 returns a Saturday date. D2:D22 skipped the weekends as it is supposed to.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    30,525

    Re: Workday formula not skipping weekend

    Sorry - I realise that now and have changed my questions. Please tell us (a) which results are wrong and (b) what you expect the formula to return.

  5. #5
    Registered User
    Join Date
    02-05-2009
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Workday formula not skipping weekend

    Quote Originally Posted by rdd2 View Post
    D23 returns a Saturday date. D2:D22 skipped the weekends as it is supposed to.
    I need column D to calculate column C plus column B, using only working hours and work days.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    30,525

    Re: Workday formula not skipping weekend

    OK - so what results are you expecting to see in the cells that you asy are not calculating correctly? Don't leave us to work it out ourselves, please - just tell us so that we know what we are working towards. Thanks.

  7. #7
    Registered User
    Join Date
    02-05-2009
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Workday formula not skipping weekend

    Sorry.

    C23 "4/12 10:50 a" + B23 "7" hours = "4/13 8:50 a"

    4/13 is a Saturday and should not be counted. D23 should equal "4/15 8:50 a" which is a Monday.

  8. #8
    Registered User
    Join Date
    02-05-2009
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Workday formula not skipping weekend

    Working hours are 7:00a to 4:00p, Monday through Friday. They are referenced on the 'Info' sheet.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    30,525

    Re: Workday formula not skipping weekend

    Thanks for the clarification.

  10. #10
    Valued Forum Contributor Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    BKK, Thailand
    MS-Off Ver
    Excel365
    Posts
    2,602

    Re: Workday formula not skipping weekend

    Please try at
    D2
    =IF(B2="","",MOD(C2+MOD(IF(E2>0,E2,B2),9)/24,1)-"9:00"*(MOD(C2+MOD(IF(E2>0,E2,B2),9)/24,1)-"16:00">0)+WORKDAY(C2,(MOD(C2+MOD(IF(E2>0,E2,B2),9)/24,1)-"16:00">0)+INT(IF(E2>0,E2,B2)/9),Info!$A$2:$A$26))
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    02-05-2009
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Workday formula not skipping weekend

    That seems to work on Excel, but this workbook is used on Google sheets. This is the error message I get when using the above formula on Google sheets...

    "Function MOD parameter 1 expects number values. But 'ACTUAL' is a text and cannot be coerced to a number."

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    30,525

    Re: Workday formula not skipping weekend

    Nowhere until now did you mention this was not for Excel ...

    I have moved the thread to the correct section.

  13. #13
    Valued Forum Contributor Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    BKK, Thailand
    MS-Off Ver
    Excel365
    Posts
    2,602

    Re: Workday formula not skipping weekend


  14. #14
    Registered User
    Join Date
    02-05-2009
    Location
    NC
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Workday formula not skipping weekend

    Thank you Bo!

+ 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