ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   read characters starting from the right until a space is reached (https://www.excelbanter.com/excel-discussion-misc-queries/63032-read-characters-starting-right-until-space-reached.html)

wolfpack95

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


PCLIVE

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




pinmaster

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


Gary Brown

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


Ron Coderre

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



wolfpack95

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



All times are GMT +1. The time now is 04:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com