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.

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?
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.

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).
Once that is done, you can use additional Excel features on each column to remove any extra spaces, etcetera.

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:
In column N

In column O

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

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,"-","")))))
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:

Open in new window

In O2, create this formula:

Open in new window

Fill down as necessary
Euro5Author Commented:
Sorry - thought that I completed that day! Thanks for the support!
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.