+ Reply to Thread
Results 1 to 6 of 6

Calculate overlap hours

  1. #1
    Registered User
    Join Date
    08-03-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    25

    Calculate overlap hours

    Hello,

    I am trying to determine the sum of total hours of downtime (trip) when there are 2 machines down during the same time period. To do this, I need to be able to determine if at any point of time there are 2 pieces of equipment down at the same time, and if this is true, how many hours were overlapped and that overlap is highlighted.

    The attached spreadsheet shows how the data is presented. I managed to do this partially if the comparsion is done with two different consecutive equipments. But if we check date 29/7/2015, we will see that 4K-002 tripped on 29/7/2015 @ 06:00 PM until 30/7/2015 03:40 AM. In between 4K-001 overlapped 4 times (29/7/2015 @07:40 PM, 29/7/2015 @ 10:35 PM, 30/7/2015 @ 12:00 AM, 30/7/2015 @ 01:00) but it was counted only once because the formula checks the current row against the next row provided one is 4K-001 and the other is 4K-002. (these are highlighted in green)

    Can someone help with this please..

    Thanks in advance
    Attached Files Attached Files

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

    Re: Calculate overlap hours

    Code for UDF
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    08-03-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    25

    Re: Calculate overlap hours

    Thanks kvsrinivasamurthy for the interesting code. it showed me that my formula is wrong even though it worked some time.

    I have made a mistake forgetting to unhide the columns between G:K. I actually wanted to show overlap time in each instance and highlight that as well similar to waht I did originally.

    an this be done as well?

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

    Re: Calculate overlap hours

    code for new UDF for individual over lap time.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-03-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    25

    Re: Calculate overlap hours

    Thankx kvsrinivasamurthy. This does the trick for me

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

    Re: Calculate overlap hours

    Thanks for the feed back.

+ 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. Calculate hours if time ranges overlap
    By hamohd70 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-05-2016, 01:06 AM
  2. calculate overlap time between 2 protagonists
    By mary128 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-23-2015, 07:55 AM
  3. [SOLVED] Calculate % overlap between two lists
    By tucanj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-07-2014, 08:33 PM
  4. Calculate total hours if time ranges overlap
    By jl_stewart in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-03-2013, 10:21 PM
  5. Replies: 0
    Last Post: 08-14-2013, 11:21 AM
  6. [SOLVED] Calculate hours with predefined Working Hours and Weekend Hours
    By garciapliz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-05-2013, 11:17 AM
  7. [SOLVED] A function that separates hours worked in work shifts that overlap
    By Katybug1964 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2005, 05:06 PM

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