Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default How to extract zip code from a 1 cell adress line?

Hi, I have been trying to extract zipcodes from a long 1 cell adress line,
but have yet to find the right way to do it, because the adresses are of
variable length.
The adresses are usually look like this:
Adress Number, Zipcode Cityname

I know that I somehow have to extract the last section of the cell, from the
second space from the right, but I have no idea of how to do it, can someone
please help?

  #2   Report Post  
Posted to microsoft.public.excel.misc
ASA ASA is offline
external usenet poster
 
Posts: 13
Default How to extract zip code from a 1 cell adress line?

Is the zip always proceeded by a comma? If so then Mid(cell,
find(",",cell)+2,5) assuming that your zip code is 5 digits long.

This finds the incidence of the first comma in your cell, then adds two
positions and gets the next 5 characters.

"Tippo22" wrote:

Hi, I have been trying to extract zipcodes from a long 1 cell adress line,
but have yet to find the right way to do it, because the adresses are of
variable length.
The adresses are usually look like this:
Adress Number, Zipcode Cityname

I know that I somehow have to extract the last section of the cell, from the
second space from the right, but I have no idea of how to do it, can someone
please help?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default How to extract zip code from a 1 cell adress line?

Thanks a lot, but what if there is two comma's in the adress? Is it possible
to find the first comma from the right, and then extract the zip from there?

"ASA" wrote:

Is the zip always proceeded by a comma? If so then Mid(cell,
find(",",cell)+2,5) assuming that your zip code is 5 digits long.

This finds the incidence of the first comma in your cell, then adds two
positions and gets the next 5 characters.

"Tippo22" wrote:

Hi, I have been trying to extract zipcodes from a long 1 cell adress line,
but have yet to find the right way to do it, because the adresses are of
variable length.
The adresses are usually look like this:
Adress Number, Zipcode Cityname

I know that I somehow have to extract the last section of the cell, from the
second space from the right, but I have no idea of how to do it, can someone
please help?

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
New Line Code for Cell Format C Brandt Excel Discussion (Misc queries) 2 June 25th 07 05:54 PM
Excel Formula for Single Cell Adress Manyfaces Excel Worksheet Functions 2 June 8th 07 08:04 PM
Return cell adress for next non-blank cell in a range toreadore Excel Worksheet Functions 1 June 28th 06 12:37 PM
How do I put an adress in a cell in multiple lines?? Jill Excel Discussion (Misc queries) 5 June 21st 06 02:09 AM
Is it possible to use a cell adress that is typed in a cell? Jon S Excel Worksheet Functions 1 March 8th 06 10:26 PM


All times are GMT +1. The time now is 09:37 PM.

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

About Us

"It's about Microsoft Excel"