Consulting

Results 1 to 9 of 9

Thread: Calculating project time

  1. #1
    VBAX Newbie
    Joined
    Jun 2008
    Posts
    5
    Location

    Calculating project time

    I have a worksheet where column A is the Project start date and time and column B is the project end date and time. I need to calculate total project time minus weekends and holidays. Our work hours are 7 a.m. until 5 p.m.

    I have been trying to use the following Excel formula but it doesn't calculte correctly.

    =(NETWORKDAYS(A2,B2,C1:C8)-1)*(D1-C1)+IF(NETWORKDAYS(B2,B2),MEDIAN(MOD(B2,1),D1,C1),D1)-MEDIAN(NETWORKDAYS(A2,A2)*MOD(A2,1),D1,C1)
    Where A2 = Start date, B2 = End date, C1:C8 = Holiday range, C1 = Day Start time and D1 = Day end Time.

    Any help would be greatly appreciated.

    Tammy

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,455
    Location
    Could it be because you have C1 as part of the holiday range and the Day start time?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Jun 2008
    Posts
    5
    Location
    Sorry, this is a type o. The Holiday range is N2:N10.

    I actually removed the Holiday range to see if this was causing the problem. Still didn't calculate correctly.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,455
    Location
    What answer are you expecting. I presume that the start and end dates don't count, but the hours do?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Newbie
    Joined
    Jun 2008
    Posts
    5
    Location
    I have copied data directly from the spreadsheet. I took out the holiday range until I can at least get the weekly total working.

    Formula
    =((NETWORKDAYS(B2,C2)-1)*(N$2-M$2)+IF(NETWORKDAYS(C2,C2),MEDIAN(MOD(C2,1),N$2,M$2),N$2)-MEDIAN(NETWORKDAYS(B2,B2)*MOD(B2,1),N$2,M$2))*24

    M2 = Day start 7:00 N2 = Day end 5:00

    B2 C2 D2(result) formatted as d:h:mm
    5/1/08 14:495/1/08 16:181:11:51

    Expected result 0:1:29

    This example doesn't even have after hours or weekends to calculate. It has been a long day, so forgive me if I am just overlooking something.

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,455
    Location
    So now you are saying that B2 has the time as well as the date, whereas in post #1 you said the start time was in C1, end time in D1.

    Now you say M2 is ths Day Start, N2 is the End Start, whereas in post #3 you said N2:N10 was the holiday range.

    How about one final, accurate, not self-contradicting, easily understandable statement of what is where?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    VBAX Newbie
    Joined
    Jun 2008
    Posts
    5
    Location
    Formula
    =((NETWORKDAYS(B2,C2)-1)*(N$2-M$2)+IF(NETWORKDAYS(C2,C2),MEDIAN(MOD(C2,1),N$2,M$2),N$2)-MEDIAN(NETWORKDAYS(B2,B2)*MOD(B2,1),N$2,M$2))*24

    M2 = Day start 7:00 N2 = Day end 5:00

    B2 C2 D2(result) formatted as d:h:mm
    5/1/08 14:495/1/08 16:181:11:51

    Expected result 0:1:29

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,455
    Location
    I can get that result easily enough, but what happens fr more than 1 day? If the end date is 2nd May, would the result be 10:59, 25:59, or something else again?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  9. #9
    VBAX Newbie
    Joined
    Jun 2008
    Posts
    5
    Location
    Project started at 5-1-08 2:49
    Day Ended at 5-1-08 5:00
    Time for day 1 = 2 Hours 11 minutes

    Day started 5-2-08 7:00
    Projected ended at 5-2-08 4:16
    Time for day 2 = 9 Hours 18 minutes

    Total Project time = 11 hours 29 minutes or
    1 10 hr work day 1 hour and 29 minutes.

Posting Permissions

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