Split one field into two

B

BW

I have a group of data that contains city, state. I need to separate this
into two separate fields. I figured if I knew how to calculate the
position of the comma I could use the left and right functions to generate
this but I'm not for sure how to determine the position of the ",". Any
ideas?



Thanks
 
C

Chip Pearson

For the city, use
=LEFT(A1,FIND(",",A1)-1)
For the state, use
=RIGHT(A1,LEN(A1)-FIND(",",A1)-1)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
G

Guest

Have you tried using text to columns? Sounds like in one field you have the
city, then a comma, then the state. If so, go to Data, Text to Columns, and
then choose delimited and click the comma option. Click next and then it
will separate them into two fields. Just make sure you have an empty column
next to the one you are trying to separate for the state data to move over
into.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top