+ Reply to Thread
Results 1 to 3 of 3

NETWORKDAYS.INTL issue when start date on weekdays end date on weekend

  1. #1
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    702

    NETWORKDAYS.INTL issue when start date on weekdays end date on weekend

    Hi All,

    I have a problem to count number of days using Networkdays.Intl when the start date on weekdays and end date on weekend. If both start and end date on weekdays it would fine.

    I am using this function, NETWORKDAYS.INTL(A1,A2,1,[Holiday])-1-MOD(A1,1)+MOD(A2,1)

    Here is simple example, Assume no holidays.
    ----------------------------------------------------
    A1 = 27-Oct-2017 18:00
    A2 = 30-Oct-2017 18:00

    B1 = 27-Oct-2017 18:00
    B2 = 29-Oct-2017 18:00 ---end on weekend


    =NETWORKDAYS.INTL(A1,A2,1)-1-MOD(A1,1)+MOD(A2,1) will return 1

    while

    =NETWORKDAYS.INTL(B1,B2,1)-1-MOD(B1,1)+MOD(B2,1) will return 0

    In fact, B1 still need to count from 18:00 to 24:000 which is 0.25 day. can anyone help me?
    1. Thank those who have helped you by clicking the Star * below the post.
    2. Please mark your post [SOLVED] if it has been answered satisfactorily.

    Sincerely,
    Farid

  2. #2
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    514

    Re: NETWORKDAYS.INTL issue when start date on weekdays end date on weekend

    Try

    =NETWORKDAYS.INTL(A1,A2,1,Holidays)+NETWORKDAYS.INTL(A2,A2,1,Holidays)*(MOD(A2,1)-1)-NETWORKDAYS.INTL(A1,A1,1,Holidays)*MOD(A1,1)

  3. #3
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    702

    Re: NETWORKDAYS.INTL issue when start date on weekdays end date on weekend

    Hi Root,

    Thanks a lot. I have tested on a few dates and it works. However, to apply it in VBA, a bit tedious

    In my real case, I am using Date/Time picker in Userform Multipage and thus need to use VBA which is more complicated.

    MOD(A1,1) in VBA does not available.


    I need to use select case due to Holidays is different depending on case.
    Then, MOD(A1,1) will change to A1/1 - Int(A1/1) to get the decimal points value.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Employee End Date with WORKDAY.INTL() function using Hire Date
    By XLOOKUP in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-10-2017, 12:18 PM
  2. Replies: 8
    Last Post: 01-31-2016, 10:14 AM
  3. NETWORKDAYS for current week minus holidays no start date
    By blackburnsexcel in forum Excel General
    Replies: 2
    Last Post: 08-24-2015, 10:08 AM
  4. NETWORKDAYS Function to calculate a start date.
    By wiseguy298 in forum Excel General
    Replies: 3
    Last Post: 12-21-2014, 07:08 PM
  5. Replies: 24
    Last Post: 10-08-2014, 10:31 AM
  6. [SOLVED] Excel 2007 : Return NA if either start or end date is blank in Networkdays
    By CatherineCarey in forum Excel General
    Replies: 3
    Last Post: 04-16-2012, 02:12 PM
  7. calculate end date using start date and number of specific weekdays
    By freekystyley in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-12-2008, 01:14 PM

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