Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default SEPARAT NUMBERS FROM TEXT

I WANT TO SEPARATE NUMBERS FROM TEXT IN A CELL ; LIKE:
A1: MR FRANK (25687)
A2: MR FRANK 256875787
A3: MR FRANK (256875) AT2008/2/6
A4: MR FRANK 2560 IN U.S
A5: 25602MR FRANK
THANK YOU.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default SEPARAT NUMBERS FROM TEXT

=LOOKUP(99^99,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0 123456789")),ROW(INDIRECT("1:"&LEN(A1))))))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"SIAMAK" wrote in message
...
I WANT TO SEPARATE NUMBERS FROM TEXT IN A CELL ; LIKE:
A1: MR FRANK (25687)
A2: MR FRANK 256875787
A3: MR FRANK (256875) AT2008/2/6
A4: MR FRANK 2560 IN U.S
A5: 25602MR FRANK
THANK YOU.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default SEPARAT NUMBERS FROM TEXT

What do you mean by "separate numbers from text in a cell"? Did you want the
text deleted and the remaining numbers left in the same cell? Did you want
the numbers deleted and the text to remain in the same cell? Did you want
the text to remain in the same cell and the numbers placed in some other
cell (or vice-versa)? Or, perhaps, something else entirely? Also, so we
don't have to guess, whatever your answer is to the above questions, what do
you expect A3 to look like afterwards?

For future reference, please don't post in all-caps... it is very hard to
read that way. Also, when you give an example of your "existing" data, it is
usually a good idea to show us how you expect it to look afterwards.

Rick


"SIAMAK" wrote in message
...
I WANT TO SEPARATE NUMBERS FROM TEXT IN A CELL ; LIKE:
A1: MR FRANK (25687)
A2: MR FRANK 256875787
A3: MR FRANK (256875) AT2008/2/6
A4: MR FRANK 2560 IN U.S
A5: 25602MR FRANK
THANK YOU.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default SEPARAT NUMBERS FROM TEXT

On Thu, 17 Jul 2008 04:27:00 -0700, SIAMAK
wrote:

I WANT TO SEPARATE NUMBERS FROM TEXT IN A CELL ; LIKE:
A1: MR FRANK (25687)
A2: MR FRANK 256875787
A3: MR FRANK (256875) AT2008/2/6
A4: MR FRANK 2560 IN U.S
A5: 25602MR FRANK
THANK YOU.


Your request is open to varying interpretations.

Here are some VBA solutions.

Enter the UDF below.
<alt-F11 opens the VB Editor
Ensure your project is highlighted in the project explorer window, then
Insert/Module and paste the code below into the window that opens.

You can then use the formula: =ReSub(cell_ref, Pattern) to "remove" what you
don't want (this is more efficient than returning what you do.

For example:

=resub(A1,"\D+") will remove everything that is NOT a digit, returning only
digits. So:

A1: MR FRANK (25687) -- 125687
A2: MR FRANK 256875787 -- 2256875787
A3: MR FRANK (256875) AT2008/2/6 -- 3256875200826
A4: MR FRANK 2560 IN U.S -- 42560
A5: 25602MR FRANK -- 525602

To remove the digits, returning only NON-digits, use "\d+" for the second
argument. =resub(A1,"\d+")

A1: MR FRANK (25687) -- MR FRANK ()
A2: MR FRANK 256875787 -- MR FRANK
A3: MR FRANK (256875) AT2008/2/6 -- MR FRANK () AT//
A4: MR FRANK 2560 IN U.S -- MR FRANK IN U.S
A5: 25602MR FRANK -- MR FRANK

To remove everything that is not a letter or a <space, returning only letters
and <spaces use "[^A-Za-z\s]+" for the second argument:
=resub(A1,"[^A-Za-z\s]+")

A1: MR FRANK (25687) -- MR FRANK
A2: MR FRANK 256875787 -- MR FRANK
A3: MR FRANK (256875) AT2008/2/6 -- MR FRANK AT
A4: MR FRANK 2560 IN U.S -- MR FRANK IN US
A5: 25602MR FRANK -- MR FRANK

If you want something else, you'll need to be more specific.




=====================================
Option Explicit
Function ReSub(str As String, sPat As String) As String
Dim re As Object
Set re = CreateObject("vbscript.regexp")
re.Global = True
re.Pattern = sPat
ReSub = re.Replace(str, "")
End Function
=====================================
--ron
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 189
Default SEPARAT NUMBERS FROM TEXT

Hi,

If you have the number of characters limited including space then try this
=MID(A3,9,20)
For eg. MR Frank is 8 digits including space if all the names are of 8
digits then you can use this. (20) actually refers to the number of character
that excel will return you can change it if you feel the characters are not
complete.
--
Thanks
Suleman Peerzade


"SIAMAK" wrote:

I WANT TO SEPARATE NUMBERS FROM TEXT IN A CELL ; LIKE:
A1: MR FRANK (25687)
A2: MR FRANK 256875787
A3: MR FRANK (256875) AT2008/2/6
A4: MR FRANK 2560 IN U.S
A5: 25602MR FRANK
THANK YOU.



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
Email (LDAP) data download into a single Excel cell - data separat MSA Excel Worksheet Functions 1 March 4th 08 05:14 PM
HOW TO ASIGN SAME NAME TO TWO DIFFERENT RANGES IN SEPARAT SHEETS Satyapal Kaushal Excel Discussion (Misc queries) 1 June 5th 07 01:31 PM
move rows of data seperated in a sheet to a sheet with no separat Lynn Excel Worksheet Functions 5 December 22nd 06 03:18 AM
VLOOKUP should compare numbers stored as text to plain numbers. VLOOKUP - Numbers stored as text Excel Worksheet Functions 0 March 31st 06 05:53 PM
Convert numbers stored as text to numbers Excel 2000 Darlene Excel Discussion (Misc queries) 6 January 31st 06 08:04 PM


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