Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
wolfpack95
 
Posts: n/a
Default read characters starting from the right until a space is reached


Is there a function to read values starting from the right of a cell and
pulling characters until I reach a space?

Two examples:
SGA3220R_IAOAKTREE (BTL-3) 1177 64089 - would return "64089"
SGA3321R_IAREDROAD (BTL-3) 1177 975 - would return "975"

I know I could do a Text to Columns with a space delimiter but was
hoping to find something easier. Thanks in advance for any help.


--
wolfpack95
------------------------------------------------------------------------
wolfpack95's Profile: http://www.excelforum.com/member.php...info&userid=93
View this thread: http://www.excelforum.com/showthread...hreadid=497953

  #2   Report Post  
Posted to microsoft.public.excel.misc
PCLIVE
 
Posts: n/a
Default read characters starting from the right until a space is reached

With your data in A1, this formula will work given that "(BTL-3) 1177 " will
always precede the number that you want to return.

=RIGHT(A1,(LEN(A1)-FIND("(BTL-3) ",A1)-12))

Hope this helps,
Paul

"wolfpack95" wrote
in message ...

Is there a function to read values starting from the right of a cell and
pulling characters until I reach a space?

Two examples:
SGA3220R_IAOAKTREE (BTL-3) 1177 64089 - would return "64089"
SGA3321R_IAREDROAD (BTL-3) 1177 975 - would return "975"

I know I could do a Text to Columns with a space delimiter but was
hoping to find something easier. Thanks in advance for any help.


--
wolfpack95
------------------------------------------------------------------------
wolfpack95's Profile:
http://www.excelforum.com/member.php...info&userid=93
View this thread: http://www.excelforum.com/showthread...hreadid=497953



  #3   Report Post  
Posted to microsoft.public.excel.misc
pinmaster
 
Posts: n/a
Default read characters starting from the right until a space is reached


Try:
=LEFT(A1,FIND(" ",A1)-1)

or
in case there are no spaces in A1
=IF(ISERROR(LEFT(A1,FIND(" ",A1)-1)),A1,LEFT(A1,FIND(" ",A1)-1))

HTH
JG


--
pinmaster
------------------------------------------------------------------------
pinmaster's Profile: http://www.excelforum.com/member.php...fo&userid=6261
View this thread: http://www.excelforum.com/showthread...hreadid=497953

  #4   Report Post  
Posted to microsoft.public.excel.misc
Gary Brown
 
Posts: n/a
Default read characters starting from the right until a space is reached


Assuming that the text will never use the character "^", then use the
following formula:-

=RIGHT(A1,LEN(A1)-FIND("^",SUBSTITUTE(A1,"
","^",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))),1))

If "^" is used replace it with a character that will never appear e.g.
¬ or ¦


--
Gary Brown
------------------------------------------------------------------------
Gary Brown's Profile: http://www.excelforum.com/member.php...o&userid=17084
View this thread: http://www.excelforum.com/showthread...hreadid=497953

  #5   Report Post  
Posted to microsoft.public.excel.misc
Ron Coderre
 
Posts: n/a
Default read characters starting from the right until a space is reached

And....another way for when there may be more than 1 space:

A1: (some text)
B1: =RIGHT(A1,MATCH("
",MID(A1,LEN(A1)+1-ROW(INDIRECT("1:"&(LEN(A1)))),1),0)-1)

Note: Commit that array formula by holding down [Ctrl]+[Shift] when you
press [enter]


Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"wolfpack95" wrote:


Is there a function to read values starting from the right of a cell and
pulling characters until I reach a space?

Two examples:
SGA3220R_IAOAKTREE (BTL-3) 1177 64089 - would return "64089"
SGA3321R_IAREDROAD (BTL-3) 1177 975 - would return "975"

I know I could do a Text to Columns with a space delimiter but was
hoping to find something easier. Thanks in advance for any help.


--
wolfpack95
------------------------------------------------------------------------
wolfpack95's Profile: http://www.excelforum.com/member.php...info&userid=93
View this thread: http://www.excelforum.com/showthread...hreadid=497953




  #6   Report Post  
Posted to microsoft.public.excel.misc
wolfpack95
 
Posts: n/a
Default read characters starting from the right until a space is reached


Thanks for all the replies. Ron Coderre's formula does what I need.


--
wolfpack95
------------------------------------------------------------------------
wolfpack95's Profile: http://www.excelforum.com/member.php...info&userid=93
View this thread: http://www.excelforum.com/showthread...hreadid=497953

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
removing a space from starting of the text shikha Excel Worksheet Functions 3 September 24th 05 11:16 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM


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