Sequentialize data from two columns

excelos

Well-known Member
Joined
Sep 25, 2011
Messages
592
Office Version
  1. 365
Platform
  1. Windows
Hello

I have the data in the format below:

IDStartEndOriginationDestination
1​
01/01/2000​
02/01/2000​
GBUS
1​
02/01/2000​
03/01/2000​
DEFR
1​
03/01/2000​
04/01/2000​
DKFI
2​
04/01/2000​
05/01/2000​
ESRO
2​
05/01/2000​
06/01/2000​
SEIT

For each ID, I need to put into an array all the origination and destination locations in time order, so that e.g.:
for ID=1, it will be {GB, US, DE, FR, DK, FI}
and
for ID=2 it will be {ES, RO, SE, IT}

Any neat way to do that without helper columns?
Thanks!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try this:

Book1
ABCDEFG
1IDStartEndOriginationDestination
212000-01-012000-01-02GBUS
312000-01-022000-01-03DEFR
412000-01-032000-01-04DKFI
522000-01-042000-01-05ESRO
622000-01-052000-01-06SEIT
7
8
91GBUSDEFRDKFI
102ESROSEIT
Sheet1
Cell Formulas
RangeFormula
A9:A10A9=LET(ID,SORT(UNIQUE(Sheet1!$A$2:$A$6)),ID)
B9:G9,B10:E10B9=LET(List,Sheet1!$A$2:$E$6,ID,A9,Org,FILTER(CHOOSECOLS(List,2,4),ID=Sheet1!$A$2:$A$6),Dest,FILTER(CHOOSECOLS(List,2,5),ID=Sheet1!$A$2:$A$6),TRANSPOSE(TOCOL(CHOOSECOLS(SORT(HSTACK(Org,Dest),1,1),2,4),1,FALSE)))
Dynamic array formulas.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,190
Members
452,616
Latest member
intern444

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