+ Reply to Thread
Results 1 to 9 of 9

Extracting Text/Numbers from an AlphaNumeric String.

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Extracting Text/Numbers from an AlphaNumeric String.

    Extracting Text/Numbers from an AlphaNumeric String.

    Dear Forum,

    I am in need of seperating Numbers and Alphabets joined by a Special Character..

    Ex:

    1> AAA/BBB


    I want to get "AAA" as well as "BBB"


    2> 123/456

    I want to get "123" as well as "456"


    3> 12/345

    I want to get "12" as well as "345"

    4> 123/45

    I want to get "123" as well as "45"


    I tried the below code but it failed

    Please Login or Register  to view this content.
    This failed in these two cases

    3> 12/345

    4> 123/45

    Warm Regards
    e4excel
    Last edited by e4excel; 08-04-2010 at 04:37 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Extracting Text/Numbers from an AlphaNumeric String.

    =Left(A1,FIND("/",A1)-1)

    and

    =MID(A1,FIND("/",A1)+1,100)

    or you can use DATA|TEXT TO COLUMNS with / as delimiter...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Extracting Text/Numbers from an AlphaNumeric String.

    Hi

    Before the oblique,

    =LEFT(A1,FIND("/",A1)-1)

    After the oblique,

    =RIGHT(A1,LEN(A1)-FIND("/",A1))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Extracting Text/Numbers from an AlphaNumeric String.

    HEy thanks everyone,


    I thought that maybe something was possible using the SUBSTITUTE function but this was very easy..thanks a lot NBVC and sweep..

    If there's any other way please feel free to ADD.

  5. #5
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Extracting Text/Numbers from an AlphaNumeric String.

    Is there a way of confirming if there exists a special character such as "/" in a cell..

    I have the cells in the Column Heading..

    144/233, 89/144 and in the last column heading it becomes just 1 which does not have "/", so how do I address this issue?

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Extracting Text/Numbers from an AlphaNumeric String.

    Try then:

    =LEFT(A1&"/",FIND("/",A1&"/")-1)

    and

    =SUBSTITUTE(MID(A1&"/",FIND("/",A1&"/")+1,100),"/","")

  7. #7
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Extracting Text/Numbers from an AlphaNumeric String.

    Hey thanks NBVC,

    can u also please tell me how do icheck for the presence of the "/" in the cell? as I tried using ISTEXT() but it fails as by putting values such as 144/233 makes the cel into TEXT.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Extracting Text/Numbers from an AlphaNumeric String.

    =Isnumber(Find("/",A1))

  9. #9
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Extracting Text/Numbers from an AlphaNumeric String.

    Quote Originally Posted by NBVC View Post
    =Isnumber(Find("/",A1))
    Thanks a lot...NBVC

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1