+ Reply to Thread
Results 1 to 7 of 7

differnet between two date

  1. #1
    Registered User
    Join Date
    04-12-2012
    Location
    AbuAlKhaseeb
    MS-Off Ver
    Excel 2010
    Posts
    99

    differnet between two date

    Hi
    I have formula for find the different between two date
    and i should put a list to (Daysoff) , and I don't know where exactly
    should i put this list . I attached file with formula
    Thank you
    Please Login or Register  to view this content.
    Notice : I put red color to part of formula (Daysoff)
    Attached Files Attached Files

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: differnet between two date

    The idea is that Daysoff is a range containing any holiday dates, you can list those anywhere you want, for example if you have holidays listed in H2:H10 you can use this formula

    =SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2&":"&B2)))<>6),--(ISERROR(MATCH(ROW(INDIRECT(A2&":"&B2)),H$2:H$10,0))))

    ....but if you have excel 2010 you can get the same result with NETWORKDAYS.INTL function, i.e.

    =NETWORKDAYS.INTL(A2,B2,17,H$2:H$10)
    Audere est facere

  3. #3
    Registered User
    Join Date
    04-12-2012
    Location
    AbuAlKhaseeb
    MS-Off Ver
    Excel 2010
    Posts
    99

    Re: differnet between two date

    Hi daddylonglegs
    I try it but not working
    and I use Excel 2010
    I tried two formula , and not working
    can you help me please , because i need it
    Thank you

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: differnet between two date

    See attached
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-12-2012
    Location
    AbuAlKhaseeb
    MS-Off Ver
    Excel 2010
    Posts
    99

    Re: differnet between two date

    Quote Originally Posted by daddylonglegs View Post
    See attached
    Hi daddylonglegs
    can you explain to me please what mean this part in your formula
    in a red color.
    Please Login or Register  to view this content.
    Ans i want you know , we have to days off at a week Friday and Saturday

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: differnet between two date

    The formula you quoted is consistent with having only Friday as the weekend, I made a mistake - 17 is the code for Saturday weekend, I should have used 16 for Friday...

    ....but you say you want to exclude Friday and Saturday so that would be one of these:

    =SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2&":"&B2)))< 6),--(ISERROR(MATCH(ROW(INDIRECT(A2&":"&B2)),H$2:H$10,0)))

    or

    =NETWORKDAYS.INTL(A2,B2,7,H$2:H$10)

    [7 is the code for Friday and Saturday weekends]

    or

    =NETWORKDAYS(A2+1,B2+1,INDEX(H$2:H$10+1,0))

    all should return the same results

  7. #7
    Registered User
    Join Date
    04-12-2012
    Location
    AbuAlKhaseeb
    MS-Off Ver
    Excel 2010
    Posts
    99

    Re: differnet between two date

    Thank you very much daddylonglegs
    Multiplicity for solution is very good thing
    And your replied was very useful to me
    thanks a lot

+ 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