Break up City, State Zip to three columns

thepartydj

Active Member
Joined
Sep 23, 2004
Messages
261
Office Version
  1. 365
Platform
  1. Windows
I currently have in one cell:
City, State zip-exzip

I would like to make that into 3 cells.

What is an easy way to do this?


Thank You!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Try this, Select your column then use the Text to columns feature, step through the guide but select Delimited then you can specify which separate to use that should then separate the data.

Example shown here before

Excel Workbook
I
1New York, USA, Zip
2New York, USA, Zip
3New York, USA, Zip
4New York, USA, Zip
5New York, USA, Zip
6New York, USA, Zip
Sheet1

After
Excel Workbook
IJK
1New YorkUSAZip
2New YorkUSAZip
3New YorkUSAZip
4New YorkUSAZip
5New YorkUSAZip
6New YorkUSAZip
Sheet1
 
Upvote 0
That will only work if there was a comma after the state, but there isn't a comma. I can't use the space delimiter either because some towns have two words. Any other suggestions?
 
Upvote 0
If your data looks like this:

<TABLE style="WIDTH: 185pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=246 border=0><COLGROUP><COL style="WIDTH: 185pt; mso-width-source: userset; mso-width-alt: 8996" width=246><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; WIDTH: 185pt; BORDER-BOTTOM: #ece9d8; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" width=246 height=20>buffalo NY 12345-1234</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>eire PA 12345-1234</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; HEIGHT: 15pt; BACKGROUND-COLOR: transparent" height=20>New London NY 12345-4568</TD></TR></TBODY></TABLE>

And if your data is in column A,

Use this in B1:=LEFT($A1,LEN($A1)-14)
Use this in C1: =MID($A1,LEN($A1)-12,2)
Use this in D1: =RIGHT($A1,10)

If your state if a different length than the two digit postal code this will not work.
 
Last edited:
Upvote 0
How come you're asking the question and we're creating the test data?!

Would you like to post a representative sample of your data?
 
Upvote 0
@Ruddles .... because I think that "city, state zip" is sample code enough. Thanks pagrender for helping me out ... Ruddles, you don't understand the question or can't figure it out you don't need to respond. Thanks again pagrender.
 
Upvote 0
Sorry, I was about to offer some assistance but I felt a more complete description of the data might have been helpful before I went off in the wrong direction (as I notice one other person did).

I'm glad you've managed to find a solution.
 
Upvote 0

Forum statistics

Threads
1,224,504
Messages
6,179,142
Members
452,892
Latest member
JUSTOUTOFMYREACH

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