Results 1 to 7 of 7

Days & Hours B/t Two Dates & Times

Threaded View

  1. #1
    Registered User
    Join Date
    07-23-2008
    Location
    Long Island
    Posts
    23

    Days & Hours B/t Two Dates & Times

    Hey,

    I can’t figure out why this formula is not working. I am trying to alter it a little, but I still think it should work. Here is what I am trying to do. I am looking to calculate the time difference between two work projects, but exclude time when the office is closed. So someone starts a project at 2pm and finish 10am the next day it will show a result of 4 hours because the office closes at 5.

    Here is the formula. It is the time formula from cpearson.com. http://www.cpearson.com/excel/DateTimeWS.htm

    =IF(AND(INT(D1)=INT(D2),NOT(ISNA(MATCH(INT(D1),HolidayList,0)))),0,ABS(IF(INT(D1)=INT(D2),ROUND(24*(D2-D1),2),(24*(DayEnd-DayStart)*(MAX(NETWORKDAYS(D1+1,D2-1,HolidayList),0)+INT(24*(((D2-INT(D2))-(D1-INT(D1)))+(DayEnd-DayStart))/(24*(DayEnd-DayStart))))+MOD(ROUND(((24*(D2-INT(D2)))-24*DayStart)+(24*DayEnd-(24*(D1-INT(D1)))),2),ROUND((24*(DayEnd-DayStart)),2))))))

    D1 is the start time of the first project. (ex: 7/4/2008 7:40:35)*
    D2 is the start of the second project & I am using that as the end time of the first project. (7/4/2008 13:01:16)*
    DayEnd is the time the office closes.
    DayStart is the time the office opens.
    *Dates in dd/mm/yyyy format.

    All my results come up as zeros, regardless of how I format the cells. I would think that this formula would be able to count down to the minute.

    Also, has anyone ever included break times using this formula? I would like to add that in, but I haven’t really focused on it yet.

    Any suggestions, ideas will be much appreciated.
    Last edited by oldchippy; 10-27-2008 at 12:04 PM.

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