Loc ID | Start Date | End Date |
1000 | 01/02/2016 | 05/03/2016 |
1000 | 25/09/2016 | 12/12/2016 |
1012 | 01/08/2016 | 24/12/2016 |
1000 | 08/05/2016 | 20/09/2016 |
1012 | 06/02/2016 | 30/07/2016 |
1000 | 01/02/2016 | 05/03/2016 |
<tbody>
[TD="class: votecell"][/TD]
[TD="class: postcell"]
I need to find out which dates are missing within multiple date ranges. All the solutions I find online are for just a simple date range for only one unique ID, e.g. Sample 1 .
I have a worksheet with +200k lines of data. Each line has a location ID and a start and end date. Each identifier has multiple sets of start & end date ranges and these can potentially be repetitive and out of order. I need to find the missing dates for each location identifier separately. I have found this question which is very similar to mine but I cannot make it work for me: Find missing dates in a range of dates in Excel
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
</tbody>
I can imagine the results can be displayed in various ways. For example, a 12-column table could show if there is a missing day/s in any month within a year for each identifier. Or a table showing missing dates for each identifier in a text string.
At the moment, this is what I have done which I find very inefficient:
I have pivoted the original data to get unique values from these three columns together. I have then made a table next to it with individual days as column headings. Each cell in this table is a binary calculated to show whether that individual day is within the range using
Code:
<code>=D$2=MEDIAN(D$2,$A2,$B2)</code>
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]Start Date
[/TD]
[TD]End Date
[/TD]
[TD]Loc ID
[/TD]
[TD]01/02/2016
[/TD]
[TD]02/02/2016
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]01/02/2016
[/TD]
[TD]05/03/2016
[/TD]
[TD]1000
[/TD]
[TD]True
[/TD]
[TD]True
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]06/02/2016
[/TD]
[TD]30/01/2016
[/TD]
[TD]1012
[/TD]
[TD]False
[/TD]
[TD]False
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]08/05/2016
[/TD]
[TD]20/09/2016
[/TD]
[TD]1000
[/TD]
[TD]False
[/TD]
[TD]False
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]01/08/2016
[/TD]
[TD]24/12/2016
[/TD]
[TD]1012
[/TD]
[TD]False
[/TD]
[TD]False
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]25/09/2016
[/TD]
[TD]12/12/2016
[/TD]
[TD]1000
[/TD]
[TD]False
[/TD]
[TD]False
[/TD]
[/TR]
</tbody>[/TABLE]
There are +18k lines in this pivot and I have at least 700+ columns for individual dates which is growing. It is not a solution because the data is being added every month and the pivot table changes. Because the binary data is pasted as value I have to start from scratch when this happens.
Could someone suggest an efficient, expandable, and updateable method please? VBA?
[/TD]
[/TR]
</tbody>[/TABLE]