Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default City, ST ZIP need to separate into 3 fields


Hi All ~

Need to separate this kind of data into 3 fields

Los Angeles, CA 90038

I found this bit of code which ALMOST does what i need it to

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


but it comes back with the State and Zip still in the same field and
there is no coma between I can use to select. Is there a way to get it
to grab only numbers?

THANKS!
JB


--
JB1981
------------------------------------------------------------------------
JB1981's Profile: http://www.excelforum.com/member.php...o&userid=34807
View this thread: http://www.excelforum.com/showthread...hreadid=545660

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 964
Default City, ST ZIP need to separate into 3 fields

For the State:

=MID(A1,FIND(",",A1,1)+2,2)

For the Zip (assuming it is always 5 digits)

=RIGHT(A1,5)

HTH,
Elkar


"JB1981" wrote:


Hi All ~

Need to separate this kind of data into 3 fields

Los Angeles, CA 90038

I found this bit of code which ALMOST does what i need it to

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


but it comes back with the State and Zip still in the same field and
there is no coma between I can use to select. Is there a way to get it
to grab only numbers?

THANKS!
JB


--
JB1981
------------------------------------------------------------------------
JB1981's Profile: http://www.excelforum.com/member.php...o&userid=34807
View this thread: http://www.excelforum.com/showthread...hreadid=545660


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default City, ST ZIP need to separate into 3 fields

JB, checkout http://www.add-ins.com/address_assistant.htm

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


"JB1981" wrote in
message ...

Hi All ~

Need to separate this kind of data into 3 fields

Los Angeles, CA 90038

I found this bit of code which ALMOST does what i need it to

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


but it comes back with the State and Zip still in the same field and
there is no coma between I can use to select. Is there a way to get it
to grab only numbers?

THANKS!
JB


--
JB1981
------------------------------------------------------------------------
JB1981's Profile:
http://www.excelforum.com/member.php...o&userid=34807
View this thread: http://www.excelforum.com/showthread...hreadid=545660



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula to Separate City, State, Zip Havenstar Excel Discussion (Misc queries) 6 January 21st 10 06:24 PM
How to change address, city, state zip code into separate columns mastertype Excel Discussion (Misc queries) 2 September 15th 09 06:41 PM
separate an address street/city,state,zip within a cell? Puzzled Excel Worksheet Functions 6 July 27th 07 12:28 PM
I wish to separate city, state, and zip into 3 separate columns Bob Woolbert Excel Worksheet Functions 1 July 11th 06 05:29 PM
Address is in separate fields Jen96 Excel Worksheet Functions 2 December 14th 05 01:50 PM


All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"