Dynamic Array to make 2 Columns

Stephen_IV

Well-known Member
Joined
Mar 17, 2003
Messages
1,176
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I need a Dynamic Array to make 2 columns with the data set that I have below.

Book3
ABCDEFGH
1NamesAnchorageANC
2Anchorage - ANCBostonBOS
3Boston - BOSSan JuanSJU
4San Juan - SJUChicagoMDW
5Chicago - MDW - ORDChicagoORD
6Honolulu - HNLHonoluluHNL
7Los Angeles - LAX - ONT - SNALos AngelesLAX
8New York - EWR - JFK - LGALos AngelesONT
9Orlando - MCOLos AngelesSNA
10Hartford - HFDNew YorkEWR
11Phoenix - PHXNew YorkJFK
12Portland - PDXNew YorkLGA
13Seattle - SEAOrlandoMCO
14Toronto - YYZ - YTZHartfordHFD
15Washington DC - IAD - DCAPhoenixPHX
16PortlandPDX
17SeattleSEA
18TorontoYYZ
19TorontoYTZ
20Washington DCIAD
21Washington DCDCA
Sheet4
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
How about
Excel Formula:
=DROP(REDUCE("",A2:A15,LAMBDA(x,y,LET(r,TRIM(TEXTSPLIT(y,,"-")),a,INDEX(r,1,1),VSTACK(x,HSTACK(EXPAND(a,ROWS(r)-1,,a),DROP(r,1)))))),1)
 
Upvote 0
Perfect! Thank you again Fluff!! You have been a lifesaver and mentor. Thanks again!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
If you are interested, another option using quite a few less functions:
Excel Formula:
=TEXTSPLIT(TEXTJOIN("|",,TEXTAFTER(SUBSTITUTE(A2:A15,"-","|"&LEFT(A2:A15,FIND("-",A2:A15))),"|"))," - ","|")
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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