+ Reply to Thread
Results 1 to 3 of 3

Sum of subintervals without counting gaps nor double counting overlaps

  1. #1
    Forum Contributor
    Join Date
    08-20-2011
    Location
    Oslo
    MS-Off Ver
    MS 365
    Posts
    245

    Sum of subintervals without counting gaps nor double counting overlaps

    Hi!

    I have start and stop datetimes in cells A19 and B19, respectively.

    I also have a spill range in E3# with various other start datetimes and a spill range in F3# with various other stop datetimes.

    All these start and stop times form intervals/durations.

    I need a formula that identifies the parts of the intervals in E3# to F3# that falls within the borders of A19 and B19 [(E3# <= B19) * (F3# >= A19)] and which sums up those subintervals without summing gaps between these subintervals and without counting overlapping time between these subintervals more than once.

    A solution that can work with the single cell input A19 and B19 would be good, but I also need a formula that can handle spill ranges as input; A19# and B19#, and create a spill range as output.

    I have attached a workbook with sample data and two formulas I have tried that fails to handle gaps and overlaps correctly.

    Thanks in advance for any suggested solutions.

    Kind regards,
    Marbleking
    Attached Files Attached Files
    Last edited by Marbleking; 01-18-2024 at 05:29 AM.

  2. #2
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Sum of subintervals without counting gaps and double counting overlaps

    I'm offering you my best calculation skills, hope it help someway.
    At least someone offered something...

    Formula to show date/time between interval:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Formula to identify overlapped time:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Formula to count the overlapped time:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    08-20-2011
    Location
    Oslo
    MS-Off Ver
    MS 365
    Posts
    245

    Re: Sum of subintervals without counting gaps nor double counting overlaps

    Thank you for this, DJunqueira! I'll dig more into your suggestion this morning. There may be some great tips there.

    I have updated my workbook with a graphic representation of what I am after. I hope for a single formula that can calculate this from the spill ranges in Section 2.

    Regards,
    Øystein
    Attached Files Attached Files
    Last edited by Marbleking; 01-18-2024 at 05:29 AM.

+ 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. Counting Time Overlaps
    By callumt683 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-23-2021, 09:55 AM
  2. Time Overlaps and Identifying Gaps
    By Angiebaby888 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-19-2019, 12:46 PM
  3. counting double
    By louis128 in forum Excel General
    Replies: 19
    Last Post: 01-02-2019, 07:52 AM
  4. Replies: 4
    Last Post: 07-13-2017, 12:24 AM
  5. [SOLVED] Overlapping Dates, Gaps in Dates, Double Counting
    By arunkushvaha in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2013, 11:15 PM
  6. Replies: 3
    Last Post: 10-12-2012, 11:18 AM
  7. Overlapping Dates, Gaps in Dates, Double Counting
    By sglxl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-24-2012, 02:46 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