Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 82
Default extract " " space from middle of a string

a1= bob 1001
there is 10 space between bob and 1001.
I want to extract bob and 1001.
find " " command retuerns the position of last " ", in this case 13. How can
I extract only "bob".

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 82
Default extract " " space from middle of a string

thanks for reply.
I used the command you mentioned (FIND(" ",A1)) but it returns 13.

"Roger Govier" wrote in message
...
Hi

=FIND(" ",A1) returns 4
=LEFT(A1,FIND(" ",A1)-1) returns bob
--
Regards

Roger Govier


"Rasoul Khoshravan" wrote in message
...
a1= bob 1001
there is 10 space between bob and 1001.
I want to extract bob and 1001.
find " " command retuerns the position of last " ", in this case 13. How
can I extract only "bob".




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default extract " " space from middle of a string

=LEFT(A5,SEARCH(" ",TRIM(A5))-1) returns "Bob"
=MID(TRIM(A5),SEARCH(" ",TRIM(A5))+1,256) returns "1001"

Regards,
Stefi


€˛Rasoul Khoshravan€¯ ezt Ć*rta:

a1= bob 1001
there is 10 space between bob and 1001.
I want to extract bob and 1001.
find " " command retuerns the position of last " ", in this case 13. How can
I extract only "bob".


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default extract " " space from middle of a string

Hi

=FIND(" ",A1) returns 4
=LEFT(A1,FIND(" ",A1)-1) returns bob
--
Regards

Roger Govier


"Rasoul Khoshravan" wrote in message
...
a1= bob 1001
there is 10 space between bob and 1001.
I want to extract bob and 1001.
find " " command retuerns the position of last " ", in this case 13.
How can I extract only "bob".



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default extract " " space from middle of a string

Hi

I wonder whether you have the non-breaking space CHAR(160) within your
string?
Try =FIND(CHAR(160),A1) and see what that produces.

If it produces a result of 4, then that is where the problem lies.
Try
=LEFT(A1,FIND(" ",SUBSTITUTE(A1,CHAR(160),""))-1)

--
Regards

Roger Govier


"Rasoul Khoshravan" wrote in message
...
thanks for reply.
I used the command you mentioned (FIND(" ",A1)) but it returns 13.

"Roger Govier" wrote in message
...
Hi

=FIND(" ",A1) returns 4
=LEFT(A1,FIND(" ",A1)-1) returns bob
--
Regards

Roger Govier


"Rasoul Khoshravan" wrote in message
...
a1= bob 1001
there is 10 space between bob and 1001.
I want to extract bob and 1001.
find " " command retuerns the position of last " ", in this case 13.
How can I extract only "bob".








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default extract " " space from middle of a string

On Wed, 11 Oct 2006 10:58:17 +0900, "Rasoul Khoshravan"
wrote:

a1= bob 1001
there is 10 space between bob and 1001.
I want to extract bob and 1001.
find " " command retuerns the position of last " ", in this case 13. How can
I extract only "bob".


You could download and install Longre's free morefunc.xll add-in from:
http://xcell05.free.fr/

and then use the formula:

=REGEX.MID(A1,"\w+") to extract the first word
=REGEX.MID(A1,"\w+",2) to extract the second

It should not matter what kind of spaces are between the two "words".


--ron
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
EXTRACT NUMBERS FROM TEXT STRING fiber_doc Excel Worksheet Functions 4 November 28th 05 06:40 PM
How do I extract 3 middle results and average them in excel SYBS Excel Worksheet Functions 4 July 2nd 05 03:14 PM
Extract hyperlink string from excel cell Ryan Sapien Links and Linking in Excel 1 January 20th 05 12:24 AM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM
How do you extract numbers from a string of chacters in a cell (E. blackbeemer Excel Worksheet Functions 6 November 12th 04 09:00 AM


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