Closed Thread
Results 1 to 12 of 12

Calculate response time in working hours between two dates

  1. #1
    Registered User
    Join Date
    06-28-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel for Mac V16.40
    Posts
    7

    Post Calculate response time in working hours between two dates

    Hi - I am new to the forum and hopefully someone can give me a hand...I am trying (in vain so far) to calculate the response time to service calls, based on working hours.

    Basic data I have is,-
    Date call received (DD:MM:YY HH:MM)
    Date call completed (DD:MM:YY HH:MM)

    Working hours are from 08:00 to 17:00
    Working days are all days, so 7 days a week 52 weeks a year

    So, for example a call is logged on 06/06/2012 09:07 and completed on 06/06/2012 11:48 the answer is simply 02:41. Easy, because both start and end date are on the same day and in working hours.
    But, if a call is logged on 06/06/2012 14:52 and completed on 07/06/2012 14:05, I can't for the life of me establish how to factor in working hours and come up with the right answer (which should be 08:13).

    I have played around with Networkdays for ages but as we operate 7 days a week I'm not sure this applies??

    Your help would be greatly appreciated.
    Many thanks,
    Andy

  2. #2
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094

    Re: Calculate response time in working hours between two dates

    Hi,

    No idea if this is the easiest way but it worked for me. Assuming your log time is in a and the completed time in b then.

    =(TIME(17,0,0)-TIME(HOUR(A2),MINUTE(A2),SECOND(A2)))+(9-(TIME(17,0,0)-((TIME(HOUR(B2),MINUTE(B2),SECOND(B2)))))*24)/24

    HTH
    Steve

  3. #3
    Registered User
    Join Date
    06-28-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel for Mac V16.40
    Posts
    7

    Re: Calculate response time in working hours between two dates

    Many thanks Steve.
    This is giving me the answers I have been getting, which when you calculate manually are just wrong!! Let me show you an example...
    Log date/time - 06/06/2012 09:07 & Completed date/time - 06/06/2012 11:48 - this is returning 11hrs:41mins when clearly its not!!

    Also, when a log date/completed date spans more than a day, it doesn't add up all the working hours:
    Log date/time - 22/05/2012 15:38 & completed date/time - 30/05/2012 11:24 - this returns 04hrs:46mins when its at least 63 'working hours'.

    Any ideas???
    Thanks again...

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Calculate response time in working hours between two dates

    pl see the attached file.
    Formula is in F column.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-28-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel for Mac V16.40
    Posts
    7

    Re: Calculate response time in working hours between two dates

    HI kvsrinivasamurthy,
    GENIUS!! Works perfectly - thanks very much indeed.
    Andy

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

    Re: Calculate response time in working hours between two dates

    Quote Originally Posted by ajagibson View Post
    ....Works perfectly....
    Although kvsrinivasamurthy's suggested formula works in many cases it can fail when dates span across different months e.g. if "Date in" is 30th June 2012 at 14:00 and "Date out" is exactly 2 days later at 2 July 2012 14:00 then clearly the result should be 18:00.....but formula returns 9:00 (that's due to use of DAY function)

    This version should work for all possible start/end dates

    =(INT(C3)-INT(B3))*("17:00"-"8:00")+MEDIAN("8:00","17:00",MOD(C3,1))-MEDIAN("8:00","17:00",MOD(B3,1))

    Important: Result cell must be formatted as [h]:mm to correctly display totals over 24 hours
    Last edited by daddylonglegs; 06-29-2012 at 06:43 AM.
    Audere est facere

  7. #7
    Registered User
    Join Date
    06-28-2012
    Location
    Nottingham, England
    MS-Off Ver
    Excel for Mac V16.40
    Posts
    7

    Re: Calculate response time in working hours between two dates

    Hi daddylonglegs - Many thanks to you too for your help and advise. I have run with this now and it all works perfectly.
    Andy

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Calculate response time in working hours between two dates

    Dear daddylonglegs,
    Thanks for correction.

  9. #9
    Registered User
    Join Date
    04-11-2019
    Location
    Chicago, Illinois
    MS-Off Ver
    MS10
    Posts
    1

    Re: Calculate response time in working hours between two dates

    Hello- Thank you for this information (very informative and am learning a lot!), however; I am having issues with internet lead response times with different business hours than listed in previous posts. I was hoping that I can get some help on this.

    Our business hours are Monday-Friday 9:00-21:00, and Saturday 9:00-17:00, closed on Sunday.

    Some lead creation (or inception) dates fall on Saturday and are not responded to until Monday which is causing issues using the aforementioned formula. Here are some of the scenarios:

    4/8/2019 20:19 4/9/2019 1:55
    4/8/2019 12:20 4/8/2019 17:21
    4/6/2019 20:09 4/8/2019 15:53
    4/6/2019 10:57 4/6/2019 16:50
    4/5/2019 20:08 4/6/2019 16:48
    4/5/2019 17:29 4/5/2019 22:36

    Is there a formula so these scenarios? Your help is appreciated!!! Many thanks

  10. #10
    Registered User
    Join Date
    06-25-2021
    Location
    Osaka, Japan
    MS-Off Ver
    2019
    Posts
    6

    Re: Calculate response time in working hours between two dates

    Quote Originally Posted by CG2304 View Post
    Hello- Thank you for this information (very informative and am learning a lot!), however; I am having issues with internet lead response times with different business hours than listed in previous posts. I was hoping that I can get some help on this.

    Our business hours are Monday-Friday 9:00-21:00, and Saturday 9:00-17:00, closed on Sunday.

    Some lead creation (or inception) dates fall on Saturday and are not responded to until Monday which is causing issues using the aforementioned formula. Here are some of the scenarios:

    4/8/2019 20:19 4/9/2019 1:55
    4/8/2019 12:20 4/8/2019 17:21
    4/6/2019 20:09 4/8/2019 15:53
    4/6/2019 10:57 4/6/2019 16:50
    4/5/2019 20:08 4/6/2019 16:48
    4/5/2019 17:29 4/5/2019 22:36

    Is there a formula so these scenarios? Your help is appreciated!!! Many thanks
    Hello everyone--this has been a very valuable post, despite its age. I have been learning a lot about it and would also like to know if anyone here was able to figure out the formula CG2304 was asking for.

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Calculate response time in working hours between two dates

    Hi.

    It's a forum rule that you start your own thread, rather than "piggy-backing" on someone else's thread... even ancient threads. This helps prevent massive confusion arising - which will happen if it is not clear which question is being answered. So please start your own thread and explain your own problem (make sure that, right from the start, you use a meaningful title (NOT things like "help needed" or "urgent problem"... think of the Google search terms that you would use to find the solution).

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 pictures. So, prepare a SMALL sample sheet (10-20 rows, not thousands!!!). Make sure there is enough data to demonstrate your need. Make sure your desired results are shown, mock them up manually if necessary. Remember to remove ALL confidential information first!!!


    The yellow banner about sample worksheets, at the top of the screen tells you how to post a sheet here on the Forum.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  12. #12
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Calculate response time in working hours between two dates

    What are the expected results.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

Closed 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