Index of terms based on overlapping dates

elbickel

New Member
Joined
May 18, 2021
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hi everyone,
I need help with a solution for how to determine and output the order and combinations of variables occurring over time for different people.
Order of variables sheet.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAO
2namevariable 1start date 1end date 1variable 2start date 2end date 2variable 3start date 3end date 3variable 4start date 4end date 4variable 5start date 5end date 5variable 6start date 6end date 6variable 7start date 7end date 7variable 8start date 8end date 8variable 9start date 9end date 9variable 10start date 10end date 101st variable combination 2nd variable combination 3rd variable combination 4th variable combination 5th variable combination 6th variable combination 7th variable combination 8th variable combination 9th variable combination 10th variable combination
3name1A01/01/201001/01/2015B01/01/2014C01/01/2015A01/01/2018E01/01/2020AA + BB + CA + B + CA + B + C + E
4name2G01/01/201501/01/2018B01/01/201501/01/2016E01/01/2019A01/01/2019B + GGA + E
5name3
6name4
7name5
Sheet1
Cells with Data Validation
CellAllowCriteria
B3:B7List=$A$10:$A$16
E3:E7List=$A$10:$A$16
H3:H7List=$A$10:$A$16
K3:K7List=$A$10:$A$16
N3:N7List=$A$10:$A$16
Q3:Q7List=$A$10:$A$16
T3:T7List=$A$10:$A$16
W3:W7List=$A$10:$A$16
Z3:Z7List=$A$10:$A$16
AC3:AC7List=$A$10:$A$16

This XL2BB shows you the layout that I am working with. I have filled in example data for 'name1' and 'name2' in the blue section of the table and the output I am after in the orange section of the table. Each person has space for up to 10 recorded variables, which can occur in any order and for any duration on time.

I am after a way to output the order of each combination of variables based on the recorded dates of each variable and whether they overlap (hopefully demonstrated by the 2 diagrams below).
Order of variables sheet.xlsx
DEFGHIJKLMNOP
8
9Name 1201020112012201320142015201620172018201920202021
10A 01/01/201001/01/201501/01/2018
11B01/01/2014
12C01/01/2015
13E01/01/2020
14
15
16
17
18
19
20
21
22Name 2201020112012201320142015201620172018201920202021
23A 01/01/2018
24B01/01/201501/01/2016
25E01/01/2018
26G01/01/201501/01/2018
27
28
29
30
31
32
33
Sheet1

The variables are recorded in chronological order based off their start date, with a 3 columns to enter the variable name, start date, and end date. Where there is a start date and no end date that means the variable is continuous to today, today is therefore assumed to be the end date. 2 variables may start on the same day and so these are just inputted next to each other.
Ie. if a person has only 2 variables recorded and they have the same start date but the first variable (A) has an end date and the second variable (B) is continuous to today then the output I need is that the 1st variable combination = A+B and the second variable combination = B.
I assume the INDEX function is the best to use for pulling the variables but I am not sure how to write a formula with it to get the outputs I need based off the overlapping date criteria.

I would really appreciate any help or ideas with how to do this!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Here is a screenshot of the diagrams:

1621415124822.png
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,752
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top