Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default isolate a number in cell with text and numbers

The database program I use exports an address into one field. I know about
text to columns and can seperate each line into a different text. My problem
now is that I can't seperate the zip code. Some address have a zip, some
have zip+4.

I've tried
=1*MID(H4,MATCH(TRUE,ISNUMBER(1*MID(H4,ROW(H:H),1) ),0),COUNT(1*MID(H4,ROW(H:H),1))) but that only seems to work on regular zip codes.

I've also tried =RIGHT(H7,FIND(" ",H7,1)+1) but it seems to give me
progressivly more characters (i.e. the zip code in cell I7, zip + 1 character
in I8, zip +2 characters in I9)

I adapted both of these from posts I found on the message board.

Thanks~
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default isolate a number in cell with text and numbers

So you addresses have either a 5 digit Zip or a 9 digit Zip+4 at the end.
Try this in B1 with address in A1
=IF(ISNUMBER(RIGHT(A1,9)*1),RIGHT(A1,9),IF(ISNUMBE R(RIGHT(A1,5)*1),RIGHT(A1,5),"???"))

This will give you the Zip or Zip+4 (as a TEXT string) as the case may be or
??? if last 9 or 5 digits are not numbers.

Use
=IF(ISNUMBER(RIGHT(A1,9)*1),RIGHT(A1,9),IF(ISNUMBE R(RIGHT(A1,5)*1),RIGHT(A1,5),""))
if you want a blank in place of ???

You can copy the formula down.

"User" wrote:

The database program I use exports an address into one field. I know about
text to columns and can seperate each line into a different text. My problem
now is that I can't seperate the zip code. Some address have a zip, some
have zip+4.

I've tried
=1*MID(H4,MATCH(TRUE,ISNUMBER(1*MID(H4,ROW(H:H),1) ),0),COUNT(1*MID(H4,ROW(H:H),1))) but that only seems to work on regular zip codes.

I've also tried =RIGHT(H7,FIND(" ",H7,1)+1) but it seems to give me
progressivly more characters (i.e. the zip code in cell I7, zip + 1 character
in I8, zip +2 characters in I9)

I adapted both of these from posts I found on the message board.

Thanks~

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default isolate a number in cell with text and numbers

That worked for zip codes, but the zip+4 codes only displayed the dash and
last 4 digits.

"Sheeloo" wrote:

So you addresses have either a 5 digit Zip or a 9 digit Zip+4 at the end.
Try this in B1 with address in A1
=IF(ISNUMBER(RIGHT(A1,9)*1),RIGHT(A1,9),IF(ISNUMBE R(RIGHT(A1,5)*1),RIGHT(A1,5),"???"))

This will give you the Zip or Zip+4 (as a TEXT string) as the case may be or
??? if last 9 or 5 digits are not numbers.

Use
=IF(ISNUMBER(RIGHT(A1,9)*1),RIGHT(A1,9),IF(ISNUMBE R(RIGHT(A1,5)*1),RIGHT(A1,5),""))
if you want a blank in place of ???

You can copy the formula down.

"User" wrote:

The database program I use exports an address into one field. I know about
text to columns and can seperate each line into a different text. My problem
now is that I can't seperate the zip code. Some address have a zip, some
have zip+4.

I've tried
=1*MID(H4,MATCH(TRUE,ISNUMBER(1*MID(H4,ROW(H:H),1) ),0),COUNT(1*MID(H4,ROW(H:H),1))) but that only seems to work on regular zip codes.

I've also tried =RIGHT(H7,FIND(" ",H7,1)+1) but it seems to give me
progressivly more characters (i.e. the zip code in cell I7, zip + 1 character
in I8, zip +2 characters in I9)

I adapted both of these from posts I found on the message board.

Thanks~

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default isolate a number in cell with text and numbers

Show us some examples of the data.

--
Biff
Microsoft Excel MVP


"User" wrote in message
...
That worked for zip codes, but the zip+4 codes only displayed the dash and
last 4 digits.

"Sheeloo" wrote:

So you addresses have either a 5 digit Zip or a 9 digit Zip+4 at the end.
Try this in B1 with address in A1
=IF(ISNUMBER(RIGHT(A1,9)*1),RIGHT(A1,9),IF(ISNUMBE R(RIGHT(A1,5)*1),RIGHT(A1,5),"???"))

This will give you the Zip or Zip+4 (as a TEXT string) as the case may be
or
??? if last 9 or 5 digits are not numbers.

Use
=IF(ISNUMBER(RIGHT(A1,9)*1),RIGHT(A1,9),IF(ISNUMBE R(RIGHT(A1,5)*1),RIGHT(A1,5),""))
if you want a blank in place of ???

You can copy the formula down.

"User" wrote:

The database program I use exports an address into one field. I know
about
text to columns and can seperate each line into a different text. My
problem
now is that I can't seperate the zip code. Some address have a zip,
some
have zip+4.

I've tried
=1*MID(H4,MATCH(TRUE,ISNUMBER(1*MID(H4,ROW(H:H),1) ),0),COUNT(1*MID(H4,ROW(H:H),1)))
but that only seems to work on regular zip codes.

I've also tried =RIGHT(H7,FIND(" ",H7,1)+1) but it seems to give me
progressivly more characters (i.e. the zip code in cell I7, zip + 1
character
in I8, zip +2 characters in I9)

I adapted both of these from posts I found on the message board.

Thanks~



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default isolate a number in cell with text and numbers

A1: Washington DC 20005
A2: New York NY 10000-1234
A3: Portland ME 04923


When I use the above-mentioned formula, I get 20005 in B1 and -1234 in B2.


"T. Valko" wrote:

Show us some examples of the data.

--
Biff
Microsoft Excel MVP


"User" wrote in message
...
That worked for zip codes, but the zip+4 codes only displayed the dash and
last 4 digits.

"Sheeloo" wrote:

So you addresses have either a 5 digit Zip or a 9 digit Zip+4 at the end.
Try this in B1 with address in A1
=IF(ISNUMBER(RIGHT(A1,9)*1),RIGHT(A1,9),IF(ISNUMBE R(RIGHT(A1,5)*1),RIGHT(A1,5),"???"))

This will give you the Zip or Zip+4 (as a TEXT string) as the case may be
or
??? if last 9 or 5 digits are not numbers.

Use
=IF(ISNUMBER(RIGHT(A1,9)*1),RIGHT(A1,9),IF(ISNUMBE R(RIGHT(A1,5)*1),RIGHT(A1,5),""))
if you want a blank in place of ???

You can copy the formula down.

"User" wrote:

The database program I use exports an address into one field. I know
about
text to columns and can seperate each line into a different text. My
problem
now is that I can't seperate the zip code. Some address have a zip,
some
have zip+4.

I've tried
=1*MID(H4,MATCH(TRUE,ISNUMBER(1*MID(H4,ROW(H:H),1) ),0),COUNT(1*MID(H4,ROW(H:H),1)))
but that only seems to work on regular zip codes.

I've also tried =RIGHT(H7,FIND(" ",H7,1)+1) but it seems to give me
progressivly more characters (i.e. the zip code in cell I7, zip + 1
character
in I8, zip +2 characters in I9)

I adapted both of these from posts I found on the message board.

Thanks~






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default isolate a number in cell with text and numbers

Try this:

All on one line.

=TRIM(RIGHT(SUBSTITUTE(TRIM(A1)
," ",REPT(" ",255)),255))

--
Biff
Microsoft Excel MVP


"User" wrote in message
...
A1: Washington DC 20005
A2: New York NY 10000-1234
A3: Portland ME 04923


When I use the above-mentioned formula, I get 20005 in B1 and -1234 in B2.


"T. Valko" wrote:

Show us some examples of the data.

--
Biff
Microsoft Excel MVP


"User" wrote in message
...
That worked for zip codes, but the zip+4 codes only displayed the dash
and
last 4 digits.

"Sheeloo" wrote:

So you addresses have either a 5 digit Zip or a 9 digit Zip+4 at the
end.
Try this in B1 with address in A1
=IF(ISNUMBER(RIGHT(A1,9)*1),RIGHT(A1,9),IF(ISNUMBE R(RIGHT(A1,5)*1),RIGHT(A1,5),"???"))

This will give you the Zip or Zip+4 (as a TEXT string) as the case may
be
or
??? if last 9 or 5 digits are not numbers.

Use
=IF(ISNUMBER(RIGHT(A1,9)*1),RIGHT(A1,9),IF(ISNUMBE R(RIGHT(A1,5)*1),RIGHT(A1,5),""))
if you want a blank in place of ???

You can copy the formula down.

"User" wrote:

The database program I use exports an address into one field. I
know
about
text to columns and can seperate each line into a different text.
My
problem
now is that I can't seperate the zip code. Some address have a zip,
some
have zip+4.

I've tried
=1*MID(H4,MATCH(TRUE,ISNUMBER(1*MID(H4,ROW(H:H),1) ),0),COUNT(1*MID(H4,ROW(H:H),1)))
but that only seems to work on regular zip codes.

I've also tried =RIGHT(H7,FIND(" ",H7,1)+1) but it seems to give me
progressivly more characters (i.e. the zip code in cell I7, zip + 1
character
in I8, zip +2 characters in I9)

I adapted both of these from posts I found on the message board.

Thanks~






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
Isolate text in a long url Lisa W Excel Worksheet Functions 8 March 13th 09 08:53 PM
isolate date from a text string into another cell Tacrier Excel Discussion (Misc queries) 5 October 11th 08 12:00 AM
extract number and use in formula from text & numbers in cell ivory_kitten Excel Worksheet Functions 3 July 14th 06 05:38 AM
isolate numbers in a cell jeremy via OfficeKB.com New Users to Excel 10 June 8th 05 11:37 PM
Isolate text following a period (".") tommcbrny Excel Worksheet Functions 2 November 9th 04 03:54 PM


All times are GMT +1. The time now is 07:38 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"