Consulting

Results 1 to 11 of 11

Thread: dates between dates???

  1. #1
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    348
    Location

    dates between dates???

    Does anyone have any slightest idea how to solve this:

    How many days between dates 22/05/2006 - 28/05/2006 represents this range of dates
    24/05/2006 - 29/05/2006

    in other words How many days from date 24/05/2006 - 28/05/2006 are actually in between from 22/05/2006 to 29/05/2006

    22/05/2006 - 28/05/2006 is like (22/05/06,23/05/06,24/05/2006 and so on) but weekends should be excluded

    any ideas?
    thnx

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Don't get it. Can you post an example?

  3. #3
    VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Bob,

    I think he needs the function NETWORKDAYS.

    Assume the start date in A1 = 1/1/2006
    The end date in B1 = 12/31/2006
    IN C1 ENTER THIS FUNCTION =NETWORKDAYS(A1,B1)
    THE RESULT IS 260
    Peace of mind is found in some of the strangest places.

  4. #4
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    NETWORKDAYS is partially correct, but we will also need to determine the true start and end date.

    A1 = 22/5/2006 (Start Date)
    B1 = 28/5/2006 (End Date)

    C1 = 24/5/2006 (Date Range Start Date)
    D1 = 29/5/2006 (Date Range End Date)

    So we have a date range in A1 and B1 and want to see how many days are inbetween the dates in C1 and D1. First we need to find the combined date range that matches our criteria.

    C2 = IF(C1<A1,A1,C1)
    D2 = IF(D1>B1,B1,D1)

    D3 = NETWORKDAYS(C2,D2)

    Or

    D3 = NETWORKDAYS(IF(C1<A1,A1,C1),IF(D1>B1,B1,D1))

    To use NETWORKDAYS you will need to install the Analysis ToolPak (Tools | Add-Ins...).

  5. #5
    VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Sorry Jake. Forgot to mention that part...
    Peace of mind is found in some of the strangest places.

  6. #6
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    348
    Location
    thnx guys for your help really apreciate it

    I neede something like DRJ wrote
    It is like this if one translator who has one document to translate let say till 22/06/2006 and he got that document 16/06/2006 so the start date of job is 16/06/2006 and deadline is 22/06/2006 and inbetween he goes for a holidays from 19/06/2006 till 25/06/2006 now i need infromation how many days is he on holidays for that document so i need result 4 because there are 4 days between 19/06/2006 and 22/06/2006

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    That is jsut standard Networkdays

    =Networkdays(start_date,end_date,holidays)

    where holidays is a range of all holiday dates

  8. #8
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    348
    Location
    I dont quite get it could you show me what you mean if I post an example of my workbook

  9. #9
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I'm afraid that clarified nothing for me.

  10. #10
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Your attachment is not really clear. At any rate, take a look at this attachment.

    Also note that believe by Holiday, he means Vacation and not an actual Holiday.

  11. #11
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by DRJ
    Also note that believe by Holiday, he means Vacation and not an actual Holiday.
    That was the one bit I did get.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •