Extract data from concatination.

I need a formula to separate out the city names in a concatenated cell. Examples are below.
In column A row 2 & 3.
US-ALABASTER---US-IRVING
US-ATLANTA---US-JACKSONVILLE

The city name will always be after a dash.
I need in column N "ALABASTER", column O "IRVING"
colunmn N "ATLANTA", column O "JACKSONVILLE"

Can anyone help?
Euro5Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

N8iveITCommented:
Simply use the Excel option for "Text To Columns", choose delimited, and see the screenshot below (assuming hyphens are *only* used to delineate each field and not used *within* a field).
ScreenShot.png
Once that is done, you can use additional Excel features on each column to remove any extra spaces, etcetera.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Martin LissOlder than dirtCommented:
Usage:
In column N
=city1(A2)

In column O
=city2(A2)

Function City1(r As Range) As String
Dim strParts() As String

strParts = Split(r, "---")
City1 = Split(strParts(0), "-")(1)
End Function

Open in new window

Function City2(r As Range) As String
Dim strParts() As String

strParts = Split(r, "---")
City2 = Split(strParts(1), "-")(1)
End Function

Open in new window

0
Shaun KlineLead Software EngineerCommented:
For column N, you can use =MID(A2, FIND("-", A2)+1, FIND("---", A2)-FIND("-", A2)-1)
For column O, you can use =RIGHT(A2, LEN(A2)-SEARCH("^^",SUBSTITUTE(A2,"-","^^",LEN(A2)-LEN(SUBSTITUTE(A2,"-","")))))
0
aikimarkCommented:
Create this function:
Public Function Q_29099537(ByVal parmCellText, ByVal parmCityNumber) As String
    'parmCityNumber should be 1 or 2
    Q_29099537 = Replace(Split(parmCellText, "US-")(parmCityNumber), "-", "")
End Function

Open in new window

In N2, create this formula:
=Q_29099537(A2,1)

Open in new window

In O2, create this formula:
=Q_29099537(A2,2)

Open in new window

Fill down as necessary
0
Euro5Author Commented:
Sorry - thought that I completed that day! Thanks for the support!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.