+ Reply to Thread
Results 1 to 5 of 5

Time Difference excluding a specific time interval

  1. #1
    Registered User
    Join Date
    04-15-2014
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    17

    Red face Time Difference excluding a specific time interval

    Hi all,

    I am calculating the time interval but excluding a specific non-service hour. In my example:

    - in cell A with the value "Aug 9 , 2018 10:05PM"
    - in cell B with the value "Aug 10, 2018 02:31PM"
    - the service hour is 10:00AM to 10:00PM, including Mon-Sun, including Public Holidays (so I need to exclude the calculation of 10:00PM to 10:00AM)

    The result of the formula should show 331 minutes.

    I've researched for days already but no luck, appreciated if anyone can help


    Nic

  2. #2
    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,036

    Re: Time Difference excluding a specific time interval

    I don't see how you get your expected answer!! In effect the answer is 14:31-10:00 = 4:31 hh:mm or 271 minutes.

    One way:

    =(INT(B2)-INT(IF(MOD(A2,1)>=$E$1,INT(A2)+1+$D$1,IF(MOD(A2,1)<$D$1,INT(A2)+$D$1,A2)))+1)*24*60*($E$1-$D$1) - (MOD(IF(MOD(A2,1)>=$E$1,INT(A2)+1+$D$1,IF(MOD(A2,1)<$D$1,INT(A2)+$D$1,A2)),1)-$D$1 + $E$1 -MOD(B2,1))*24*60
    Attached Files Attached Files
    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

  3. #3
    Registered User
    Join Date
    04-15-2014
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Time Difference excluding a specific time interval

    Hi Glenn,

    Thanks a lot!!! The formula works!! This is exactly the result I want Although I don't really understand the formula, thanks a lot again for your great help!


    Nicky

  4. #4
    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,790

    Re: Time Difference excluding a specific time interval

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    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.

  5. #5
    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,036

    Re: Time Difference excluding a specific time interval

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. [SOLVED] showing the 2 chart line with 2 difference time sampling interval in one graph
    By fakhteh in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-10-2016, 07:35 AM
  2. Replies: 5
    Last Post: 08-24-2015, 09:28 PM
  3. Replies: 1
    Last Post: 08-13-2015, 08:37 AM
  4. [SOLVED] Time interval difference - value error ?
    By Lukael in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 04-23-2014, 12:11 PM
  5. Difference between two dates and time excluding Sunday
    By arafats in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-28-2013, 02:44 AM
  6. interval in specific time
    By pan_arshad in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-18-2012, 04:19 AM
  7. Replies: 0
    Last Post: 04-23-2012, 10:06 AM

Tags for this Thread

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