+ Reply to Thread
Results 1 to 15 of 15

Calculating no. of business hours for enquiries received

  1. #1
    Registered User
    Join Date
    05-24-2023
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    6

    Calculating no. of business hours for enquiries received

    Hi all,

    Hoping to get some help with the following:

    I'm looking to calculate the no. of business hours our enquiries have been open for, and the time taken to close enquiries (two separate lists and formulas).

    For calculating enquiry open time, I want to take the current date and time and minus the date and time the enquiry was open (I'm in Australia so date formatting is dd/mm/yy. For example:

    Current date and time = 24/05/2023 10:23 AM - enquiry open date and time 10/05/2023 2:44 PM. What I want to know is the total number of business hours, (represented in business days) the enquiry has been open. Our business hours are 9am to 5pm, Monday to Friday.

    I'm having difficulty including enquiries that were opened outside of business hours and enquiries that have only just opened.

    Similarly I am wanting to calculate the difference between enquiry open date and time and enquiry close date and time. This is what I've managed to come up with for close date and time - open date and time (open in column C and close in column D):

    =MAX(IF(AND(TEXT(C43,"ddd")<>"Sat", TEXT(C43,"ddd")<>"Sun"),
    IF(AND(TEXT(D43,"ddd")<>"Sat", TEXT(D43,"ddd")<>"Sun"),
    NETWORKDAYS(C43,D43)-1,
    NETWORKDAYS(C43,D43)
    ),
    IF(AND(TEXT(D43,"ddd")<>"Sat", TEXT(D43,"ddd")<>"Sun"),
    NETWORKDAYS(C43,D43)-1+(NETWORKDAYS(D43,D43)-1)*(MOD(D43,1)-TIME(17,0,0))/(TIME(17,0,0)-TIME(9,0,0)),
    0
    )
    ) + (MOD(D43,1)-MOD(C43,1))/(TIME(17,0,0)-TIME(9,0,0)), 0)

    Previously I've done this by referencing a date calendar sheet, I am wondering if it's possible to do with a formula. Seems like it will be a very complicated one!

    Thanks in advance for any suggestions!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Calculating no. of business hours for enquiries received

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-24-2023
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Calculating no. of business hours for enquiries received

    Thanks for letting me know. I have attached a doc with my current attempted formulas and my expected results with some further info.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-24-2023
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Calculating no. of business hours for enquiries received

    Quote Originally Posted by tsabicon1989 View Post
    Thanks for letting me know. I have attached a doc with my current attempted formulas and my expected results with some further info.
    Hi again,

    Just wondering if anyone has any ideas for the issue I'm having.

    Thanks again.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Calculating no. of business hours for enquiries received

    This is not helpful:

    *Hopefully all these expected results are correct
    Expected results MUST be correct. Only add the ones that you KNOW are so.

  6. #6
    Registered User
    Join Date
    05-24-2023
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Calculating no. of business hours for enquiries received

    Right...

    Okay these expected results are correct....
    Attached Files Attached Files

  7. #7
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,427

    Re: Calculating no. of business hours for enquiries received

    Please can you explain the first expected result (1,99).
    I don't understand how you got there.

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Calculating no. of business hours for enquiries received

    I was just about to ask the same as Hans - please talk us through the manual calculation for that first result.

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

    Re: Calculating no. of business hours for enquiries received

    In sheet " Open Enquiry Time" in G2 copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In sheet " Enquiry time to close" in G2 copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  10. #10
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: Calculating no. of business hours for enquiries received

    Can OP confirm result for Reference Number 2 should be:

    business hours calc.png

  11. #11
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    200

    Re: Calculating no. of business hours for enquiries received

    Hi to all!

    [K1] = 9:00
    [J1] = 17:00

    All formulas in [G2]:

    Sheet "Open Enquiry Time"
    PHP Code: 
    =((K$1-J$1)*(NETWORKDAYS(C2,H$1)-1)+MEDIAN((WEEKDAY(H$1,2)>5)+MOD(H$1,1),J$1,K$1)-MEDIAN((WEEKDAY(C2,2)<6)*MOD(C2,1),J$1,K$1))/(K$1-J$1
    Sheet "Enquiry time to close"
    PHP Code: 
    =((K$1-J$1)*(NETWORKDAYS(C2,D2)-1)+MAX(MOD(D2,1),J$1)-MEDIAN((WEEKDAY(C2,2)<6)*MOD(C2,1),J$1,K$1))/(K$1-J$1
    Check file. Blessings!
    Attached Files Attached Files
    Last edited by John Vergara; 06-01-2023 at 02:36 PM.
    A out-of-context text is a pretext.
    Consider adding reputation points to all the people who help you with your question/problem.

  12. #12
    Registered User
    Join Date
    05-24-2023
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Calculating no. of business hours for enquiries received

    Hi all,

    Apologies I haven't responded earlier, thank you for all your help! John and kvsrinivasamurthy formulas for the first calculation (Open Enquiry Time) are working. Thank you so much!

    For Time to Close, apologies, I have had to go back to the drawing board.

    For enquiries that are closed outside of business hours, I would like the close time to be updated to the end of the previous business day. So, for example if an enquiry was closed on Sunday - 4/06/2023 1:13 AM - I would like the close time to be Friday 2/06/2023 5:00 PM. negative numbers I will simply round up to 0.

    I have attached a spreadsheet with requirements and expected results (and how I get to these results).

    Thanks again,
    Attached Files Attached Files

  13. #13
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,427

    Re: Calculating no. of business hours for enquiries received

    One way, please try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    05-24-2023
    Location
    Sydney, Australia
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Calculating no. of business hours for enquiries received

    Many thanks Hans,

    that looks to be correct!

  15. #15
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,427

    Re: Calculating no. of business hours for enquiries received

    You are Welcome. Glad to have helped.

    Please considder adding reputation to any helpers you think they deserve.
    In that case please click * Add Reputation left below their answers.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Capture response time for orders received but subtract non-business hours
    By georgezdpt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-09-2022, 10:39 AM
  2. Calculating % of tickets that have been resolved within business hours
    By rinkydink in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-22-2021, 12:19 PM
  3. Calculating business days, hours and minutes
    By mayraguilar in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-12-2016, 01:23 PM
  4. [SOLVED] Calculating working hours between two dates and business hours
    By mangesh in forum Excel General
    Replies: 3
    Last Post: 06-08-2015, 03:02 AM
  5. Need help Calculating Elasped time excluding non business hours.
    By hellpme in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-29-2013, 03:52 PM
  6. Replies: 1
    Last Post: 11-29-2011, 12:19 AM
  7. Calculating Business Hours Between 2 Dates
    By tanya216 in forum Excel General
    Replies: 3
    Last Post: 04-11-2006, 10:30 AM

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