#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 125
Default Find last space

Can you let me have the function for finding the last space in a string?
At the same time, for future ref the #th space in a string please.

My present problem is to separate the number at the end of a series of
strings, typically:

0 - Council and Club Meetings 27

I need to find the last space in order to separate
0 - Council and Club Meetings
and
27
into two cells using =LEFT() and =RIGHT()

Francis Hookham


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Find last space

=FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))

gets the last space

=LEFT(A1,FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1,"
","")))))

gets the characters upto the last space

--
HTH

Bob

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

"Francis Hookham" wrote in message
...
Can you let me have the function for finding the last space in a string?
At the same time, for future ref the #th space in a string please.

My present problem is to separate the number at the end of a series of
strings, typically:

0 - Council and Club Meetings 27

I need to find the last space in order to separate
0 - Council and Club Meetings
and
27
into two cells using =LEFT() and =RIGHT()

Francis Hookham



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 125
Default Find last space

Many thanks Bob - just the job - I wish I understood how it is constructed!

When I extract the numbers from the end of the string they are still text
and I need to use them as numbers - how?

While on the subject of finding spaces, how do I use your formula to find a
specified space - say the 4th space in a string?

Francis


"Bob Phillips" wrote in message
...
=FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))

gets the last space

=LEFT(A1,FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1,"
","")))))

gets the characters upto the last space

--
HTH

Bob

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

"Francis Hookham" wrote in message
...
Can you let me have the function for finding the last space in a string?
At the same time, for future ref the #th space in a string please.

My present problem is to separate the number at the end of a series of
strings, typically:

0 - Council and Club Meetings 27

I need to find the last space in order to separate
0 - Council and Club Meetings
and
27
into two cells using =LEFT() and =RIGHT()

Francis Hookham





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Find last space

=FIND("^^",SUBSTITUTE(A2," ","^^",4))

will give you the number counted from the left of the 4th space

so

We have no bananas today sir, how about a durian fruit instead?

would return 19 since the 4th space counted from the left is in the 19th
place

meaning that if you want what's left of the 19th character you would use

=LEFT(A2,FIND("^^",SUBSTITUTE(A2," ","^^",4))-1)

Note that the ^^ can be replaced with any character(s) that is not used on
a regular basis in a text string.


--
Regards,

Peo Sjoblom


"Francis Hookham" wrote in message
...
Many thanks Bob - just the job - I wish I understood how it is
constructed!

When I extract the numbers from the end of the string they are still text
and I need to use them as numbers - how?

While on the subject of finding spaces, how do I use your formula to find
a specified space - say the 4th space in a string?

Francis


"Bob Phillips" wrote in message
...
=FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))

gets the last space

=LEFT(A1,FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1,"
","")))))

gets the characters upto the last space

--
HTH

Bob

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

"Francis Hookham" wrote in message
...
Can you let me have the function for finding the last space in a string?
At the same time, for future ref the #th space in a string please.

My present problem is to separate the number at the end of a series of
strings, typically:

0 - Council and Club Meetings 27

I need to find the last space in order to separate
0 - Council and Club Meetings
and
27
into two cells using =LEFT() and =RIGHT()

Francis Hookham







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
Using FIND function to locate space between first and last name Dennis_in_nh Excel Worksheet Functions 1 April 19th 06 08:13 PM
How to find and replace blank space (x) in John Smithx in Excel? JoeSAT Excel Discussion (Misc queries) 5 March 19th 06 04:39 PM
Paper Space / Model Space ? Coolboy55 Excel Discussion (Misc queries) 0 September 1st 05 08:58 PM
Can I find and replace "white space" in a cell in Excel? biggyb75 Excel Worksheet Functions 7 July 11th 05 04:58 PM
Find last space from the right of text Myrna Larson Excel Discussion (Misc queries) 5 March 29th 05 12:15 AM


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

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"