Dynamic Array to make 2 Columns

Stephen_IV

Well-known Member
Joined
Mar 17, 2003
Messages
1,168
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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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,215,262
Messages
6,123,939
Members
449,134
Latest member
NickWBA

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