Event timeline with a condition

virtuosok

Board Regular
Joined
Sep 2, 2020
Messages
209
Office Version
  1. 365
Platform
  1. Windows
Hi,
I have the attached source file (it's an export from an external database, I'm getting a fresh version daily so there are always some fresh additions).
The focus is on column A (site number) and then columns N-S with various event types in the header, and their dates within, I highlighted in green for better visibility. What I need is a set of formulas to create some kind of a timeline for a selected site #, on a separate tab.
This is an example of what I'm trying to get at (dates are arbitrary):
Site #screeningrandomizationscreeningscreening failuretreatment discontinuationscreening failure
148​
23-Sep-2020​
1-Oct-2020​
15-Nov-2020​
1-Jan-2021​
16-Feb-2021​
12-Mar-2021​
The problem is that these events are somewhat erratic, there's no particular sequence - it can be couple of screenings in a row followed by a randomization, or screening and then screening failure... or almost any other combination... so I can't pre-program event headers in the timeline. For each individual site #, there will be a different # of events, and a different sequence too, so I need the timeline to refresh after I key in a new site #. What's worse, it may well happen that there are several events happening on the same day for a specific site, and I need to pull them all in the timeline with their own header. In case of multiple events on a single day, there's no particular preference which one should come up first in the timeline, as long as they are all there. Is it even possible?
While I mainly use Excel 2016, I'll happily accept 365 version of the formula if that's a game changer...
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi Crystalyzer,
Sorry, is the link embedded in my original email not working? That's where the source file is posted on Google Drive.
 
Upvote 0
So per your example above for site 148 I see this data
Blinded output 003.xlsx
ABCDEFGHIJKLMNOPQRS
60148United States4000n/aScreen FailureInactiveScreen Failure23 Sep 202023 Sep 202023 Sep 2020n/an/an/an/a
61148United States4034n/aScreen FailureInactiveScreen Failure18 Dec 202018 Dec 202018 Dec 2020n/an/an/an/a
62148United States4086n/aScreen FailureInactiveScreen Failure26 Feb 202126 Feb 202126 Feb 2021n/an/an/an/a
63148United States4184n/aScreen FailureInactiveScreen Failure21 May 202121 May 202121 May 2021n/an/an/an/a
64148United States4226n/aScreen FailureInactiveScreen Failure28 Jul 202124 Jun 202128 Jul 2021n/an/an/an/a
IWRS003

What would be the expected output for site 148? Should we also be breaking on "Subject Number" to differentiate by subject?
 
Upvote 0
Hi Virtuosok,

So you want to show in columns all entries for a specified Site?
This assumes the data is sorted in date sequence within site (which is was for the few I checked).

Your example doesn't match the entries for 148 (which only had 4 entries, all for "Screen Failure") so I'll use Site 165 which has 18 entries. Just copy the B1 and B2 formulae right as many columns as you'll ever need.

Cell Formulas
RangeFormula
B1:T1B1=IFERROR(INDEX(IWRS003!$L$2:$L$99999,AGGREGATE(15,6,ROW(IWRS003!$A$2:$A$99999)-ROW(IWRS003!$A$1)/(IWRS003!$A$2:$A$99999=$A$2),COLUMN()-COLUMN($A$1))),"")
B2:T2B2=IFERROR(INDEX(IWRS003!$M$2:$M$99999,AGGREGATE(15,6,ROW(IWRS003!$A$2:$A$99999)-ROW(IWRS003!$A$1)/(IWRS003!$A$2:$A$99999=$A$2),COLUMN()-COLUMN($A$1))),"")
Named Ranges
NameRefers ToCells
IWRS003!_FilterDatabase=IWRS003!$A$1:$BE$253B1:T2
 
Upvote 0
How about, for 365 only
Blinded output 003.xlsx
ABCDEFGHIJK
1
2148Screening DateScreen Failure DateScreening DateScreen Failure DateScreening DateScreen Failure DateScreening DateScreen Failure DateScreening DateScreen Failure Date
323/09/202023/09/202018/12/202018/12/202026/02/202126/02/202121/05/202121/05/202124/06/202128/07/2021
4
Sheet1
Cell Formulas
RangeFormula
B2:K3B2=LET(Fltr,FILTER(IWRS003!N1:S253,(IWRS003!A1:A253=A2)+(ROW(IWRS003!N1:S253)=1)),Rws,ROWS(Fltr)-1,Qty,SEQUENCE(,Rws*COLUMNS(Fltr),0),Ary,INDEX(Fltr,MOD(Qty,Rws)+2,INT(Qty/Rws)+1),SORT(FILTER(CHOOSE({1;2},INDEX(Fltr,SEQUENCE(,Rws*COLUMNS(Fltr),1,0),INT(Qty/Rws)+1),Ary),Ary<>"n/a"),2,,1))
Dynamic array formulas.


But you will need to converts your "dates" in columns N:S into real dates rather than text.
 
Last edited:
Upvote 0
Thank you all! Toadstool it looks like the proposed solution works! I will test it in the next few days and will revert if any questions.
Have a great weekend all!
 
Upvote 0
Hi Fluff, the solution works as well, but converting the dates is not very practical in my particular situation. However this is a very unconventional approach and I am learning a LOT by just sifting through the proposed formula... greatly appreciated as I'm going through differences in Excel 365 vs 2016....
 
Upvote 0
I thought you were after the details in columns N:S, not cols L & M?

If you don't want to convert the dates you can use this instead
Excel Formula:
=LET(Fltr,FILTER(IWRS003!N1:S253,(IWRS003!A1:A253=A2)+(ROW(IWRS003!N1:S253)=1)),Rws,ROWS(Fltr)-1,Qty,SEQUENCE(,Rws*COLUMNS(Fltr),0),Ary,INDEX(Fltr,MOD(Qty,Rws)+2,INT(Qty/Rws)+1),SORT(FILTER(CHOOSE({1;2},INDEX(Fltr,SEQUENCE(,Rws*COLUMNS(Fltr),1,0),INT(Qty/Rws)+1),Ary+0),Ary<>"n/a"),2,,1))
 
Upvote 0
Solution

Forum statistics

Threads
1,224,166
Messages
6,176,846
Members
452,745
Latest member
CommonManCrypto

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