+ Reply to Thread
Results 1 to 16 of 16

find Sum of # of days w/o counting overlapping days twice with multiple paramaters

  1. #1
    Registered User
    Join Date
    05-09-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    7

    find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    I a was able to locate the below formula to count days without including the overlapping counts, however this only to only work for situations where the specific cell range is known. =SUM(1*(MMULT(((MIN(A2:A5)-ROW(A2)+ROW(OFFSET(A2,0,0,MAX(B2:B5)-MIN(A2:A5)+1,1)))>=TRANSPOSE(A2:A5))*((MIN(A2:A5)-ROW(A2)+ROW(OFFSET(A2,0,0,MAX(B2:B5)-MIN(A2:A5)+1,1)))<=TRANSPOSE(B2:B5)),C2:C5)>0))-1

    I currently have 1000+ rows of start/end dates that belong to only about 200 unique "files". I am looking to do a vlookup from one sheet, where the file has one occurrence, to the sheet with all of the dates. Any thoughts on how to incorporate that look up?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    First Step

    Use Text Join to Concatenate your dates.

    Insert this into cell E2 using Ctrl Shift Edit and then fill Down

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


    That Gives you the List Of Dates for each file.

    You can feed that list into a userdefined function using the formula in E2:-

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


    Entered using Ctrl Shift Enter

    Paste the Userdefined Function in to a Macro Module to make it all work:-


    Please Login or Register  to view this content.

    This Formula is probably better:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 05-09-2016 at 08:51 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    05-09-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    7

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    That doesn't work for some reason. Example: File 'dft' has one date itself with greater than thr return result with that formula of 26 days. Row 20 dates for 'dft' are 2/25-3/28 which is 32 days itself. So that plus the other non overlapping date in row 10 of 7/10-7/10 should have resulted in the total days being 33.

  4. #4
    Registered User
    Join Date
    05-09-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    7

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    Would there be an easier way of using this formula below, expanding it to include all data, then adding an additional formula around it to search similar to you have above by looking for the unique id using the file#?

    =SUM(1*(MMULT(((MIN(A2:A5)-ROW(A2)+ROW(OFFSET(A2,0,0,MAX(B2:B5)-MIN(A2:A5)+1,1)))>=TRANSPOSE(A2:A5))*((MIN(A2:A5)-ROW(A2)+ROW(OFFSET(A2,0,0,MAX(B2:B5)-MIN(A2:A5)+1,1)))<=TRANSPOSE(B2:B5)),C2:C5)>0))-1

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    Try this version.

    Please Login or Register  to view this content.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    Quote Originally Posted by civ1979 View Post
    That doesn't work for some reason. Example: File 'dft' has one date itself with greater than thr return result with that formula of 26 days. Row 20 dates for 'dft' are 2/25-3/28 which is 32 days itself. So that plus the other non overlapping date in row 10 of 7/10-7/10 should have resulted in the total days being 33.

    Mine comes up with 34 for that one. Array-entered.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Applying filters to Sheet2 I come up with same. What am I missing?
    Dave

  7. #7
    Registered User
    Join Date
    05-09-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    7

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    Ok, back at this again. The formula listed just above this entry worked last month, however I had to go in to each reference entry and adjust the formula to capture the dates only applicable to each reference number. attached is actual data I am using this on. There are 'begin' and 'end' dates for which I need to capture any dates that there is part of the time there was an open issue(opened/closed). For example, reference# *1205083 would have 99 actual days(excluding duplicates) between begin/end that the file was in an open status. Is there a way to have this formula added to automatically reference ONLY the data within the columns and rows pertaining to JUST the reference number in the applicable row?
    Attached Files Attached Files

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    Are the rows always going to be grouped contiguously as in the upload?

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    civ1979,

    This seems to work for everything but duplicate dates and maybe row 4. For example I get 17 instead of 16 in row 8. I haven't found a way to resolve the 'look-backs' yet.

    Also I get 0 for row 4 ... 4/6/2016 -- 4/6/2016. Is that what you expect?

    In F2 and filled down.

    =MIN(E2,B2)-MAX(D2,A2)
    Last edited by FlameRetired; 06-06-2016 at 02:40 PM.

  10. #10
    Registered User
    Join Date
    05-09-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    7

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    yes, I can always have the data sorted by reference# and opened date. The formula you gave works for the specific row of data, however I am trying to count all days for all occurrences of the reference number in column C. So for reference# *1205083, the total of all columns days(excluding duplicate days) is 99.

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    So for reference# *1205083, the total of all columns days(excluding duplicate days) is 99.
    Ok. That's clearer.

  12. #12
    Registered User
    Join Date
    05-09-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    7

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    Thanks. Sorry. Any help is appreciated. I am sure there is smart ways than using formulas(like the above function comments), but I am not skilled enough for that yet.

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    civ1979,

    I finally resorted to laying out parallel time lines.

    I get 103 for Reference# *1205083, duplicate dates counting as 1.

    Would you double check that 99 figure you have?
    Last edited by FlameRetired; 06-06-2016 at 08:35 PM.

  14. #14
    Registered User
    Join Date
    05-09-2016
    Location
    US
    MS-Off Ver
    2010
    Posts
    7

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    I get 99 ----- The date range to search would be 10/31/15-5/26/16(start vs end)


    Start Date End Date Reference# Opened Closed
    10/31/2015 5/26/2016 *1205083 10/22/2015 12/28/2015 -- 58 --- start date is greater than "opened date" so this is E2-A2
    10/31/2015 5/26/2016 *1205083 12/29/2015 1/12/2016 -- 14 --- this is e2-d2
    10/31/2015 5/26/2016 *1205083 1/12/2016 1/29/2016 -- 16 --- this is e2-d2(minus 1 since 1/12/16 is part of the count in the row above)
    10/31/2015 5/26/2016 *1205083 1/14/2016 1/19/2016 -- --- no count as ALL are duplicates of the row above this
    10/31/2015 5/26/2016 *1205083 5/5/2016 5/16/2016 -- 11 --- e2-d2

  15. #15
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    I'm stumped. Calling for community help.

  16. #16
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: find Sum of # of days w/o counting overlapping days twice with multiple paramaters

    civ1979, you may try running this on your worksheet.
    Please Login or Register  to view this content.
    There are some ambiguity, especially for those where start and end dates are the same day; should that be 1 or 0 days?
    多么想要告诉你 我好喜欢你

+ 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. Find number of overlapping days per person
    By maryjane84 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-21-2016, 12:46 PM
  2. [SOLVED] How to find Sum of # of days w/o counting overlapping days twice
    By lanksout in forum Excel General
    Replies: 18
    Last Post: 08-11-2015, 02:15 AM
  3. Count number of overlapping days in multiple date ranges
    By tarsonis in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 05-08-2015, 03:22 PM
  4. [SOLVED] Find days between days, but including the starting date.
    By Jocamo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-25-2015, 10:37 PM
  5. Replies: 0
    Last Post: 07-30-2012, 04:51 PM
  6. Counting Continuous Days within overlapping Date Ranges
    By mgaworecki in forum Excel General
    Replies: 3
    Last Post: 09-07-2011, 08:33 AM
  7. Replies: 9
    Last Post: 09-03-2007, 08:26 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