+ Reply to Thread
Results 1 to 4 of 4

Have date ranges. Given a bigger date range, I need to identify gaps.

  1. #1
    Registered User
    Join Date
    03-16-2012
    Location
    MN
    MS-Off Ver
    Excel 2010
    Posts
    50

    Have date ranges. Given a bigger date range, I need to identify gaps.

    I have data that looks like this:

    Name MediaID StartDate EndDate
    Mike 00001 02/01/18 10/31/18
    Mike 00001 05/01/18 09/30/18
    Lisa 00001 05/01/17 02/28/18
    Lisa 00002 01/01/19 05/31/19
    Lisa 00003 02/01/16 10/31/16

    I get questions that I need to answer like this (I do not know if these answers are correct, this is just an example, but even mocking this up just emphasized why I need a solution):

    Question 1:
    I need data for Mike from 1/1/18-12/31/19
    Answer 1:
    I need to get data for 1/1/18-1/31/18 and 11/1/18-12/31/19

    Question 2:
    I need data for Lisa for 1/1/17 - present
    Answer 2:
    I need to get data for 1/1/17-4/31/17 and 3/1/18-12/31/18 and 6/1/19-present

    I am pursuing a solution in Access also. I am pretty much looking for any shortcuts to get this done, I have no idea where to start.

    EDIT: all of the dates will be within the last ten years
    EDIT2: added sample data
    Attached Files Attached Files
    Last edited by James Keuning; 12-06-2019 at 10:59 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,451

    Re: Have date ranges. Given a bigger date range, I need to identify gaps.

    Please read the yellow banner

  3. #3
    Registered User
    Join Date
    03-16-2012
    Location
    MN
    MS-Off Ver
    Excel 2010
    Posts
    50

    Re: Have date ranges. Given a bigger date range, I need to identify gaps.

    done; thanks

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,594

    Re: Have date ranges. Given a bigger date range, I need to identify gaps.

    First of all let me say that I believe this is going to be pretty resource intense.
    In the attached file the green shaded cells will need to be filled manually with the name, first date for which data needs to be gathered and last date for which data needs to be gathered.
    The cells in I2:I750 show all of the "gap" dates and are populated with the following amazing array entered formula* (which I stole from another contributor about four years ago, I have forgotten whom so I apologize for not giving due credit):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Cells J2:J750 identify the start (1) and end (2) of each range of dates and are populated using: =IF(ISERR(I2),"",IF(ISERR(I3),2,IF(I2>SUM(I1,1),1,IF(SUM(I2,1)< I3,2,""))))
    Cells F2:G6 show the "non gap" dates for the person and data range using: =IFERROR(INDEX(C$2:C$6,AGGREGATE(15,6,(ROW(C$2:C$6)-ROW(C$1))/($A$2:$A$6=$E$1)/($D$2:$D$6>=$F$1),ROWS($A$1:$A1))),"")
    Cells F8:G11 (shaded blue) displays the output ranges using: =IFERROR(INDEX($I$2:$I$750,AGGREGATE(15,6,(ROW($I$2:$I$750)-ROW($I$1))/($J$2:$J$750=COLUMNS($A$1:A$1)),ROWS($A$1:$A1))),"")
    Note that columns I:J may be moved and or hidden for aesthetic purposes.
    *Array entered formulas are confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] Identify if date falls within a date range
    By Chris F in forum Excel - New Users/Basics
    Replies: 14
    Last Post: 02-23-2022, 08:40 AM
  2. Compare date range to list of ranges and identify gaps
    By James Keuning in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-13-2019, 12:05 AM
  3. Replies: 8
    Last Post: 11-02-2017, 01:19 AM
  4. [SOLVED] determine total overlap time when there are gaps in overlap (4 date ranges)
    By miriambender in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-12-2014, 11:58 PM
  5. Date Ranges with Gaps - Finding Corresponding Maximum
    By thankfulsupplicant in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-10-2013, 07:43 PM
  6. Date Range - Start and End Date - Identify dates in a quarter
    By Nikki Fox in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-12-2012, 06:05 AM
  7. [SOLVED] Identify gaps in dates within a range
    By leslieharris in forum Excel General
    Replies: 5
    Last Post: 08-12-2012, 02:01 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