+ Reply to Thread
Results 1 to 12 of 12

How to extract one or two 11 digits numbers from an alpha numeric string

  1. #1
    Registered User
    Join Date
    01-31-2011
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    23

    How to extract one or two 11 digits numbers from an alpha numeric string

    I have data in cells like this.
    A1= SYED AKHTAR ALI SHAH 3630203120065 03009632964
    A2= Nisar Ahmad Nadeem 03006884081
    A3= KHADIM HUSSAIN 3630309830551 03027369268

    Now every cell has text and two or three numbers separated by uneven spaces.
    I want to
    1. extract the last 11 digit number from each cell i.e the one starts with 03
    2. If in a cell there are two 11 digits numbers starting with 03, I want to extract them both either in separate cells or in one cell but with comma separator.

    I am an average user so unable to capitalize on the previous discussion by you guys.
    Thanking you in anticipation.
    Last edited by neo4u44; 11-16-2011 at 08:55 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: How to extract one or two 11 digits numbers from an alpha numeric string

    =mid(a1,find(" 03",a1)+1,11)&if(iserror(mid(a1,find(" 03",a1,find(" 03",a1)+1)+1,11)),"",", "&mid(a1,find(" 03",a1,find(" 03",a1)+1)+1,11))

  3. #3
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    1,252

    Re: How to extract one or two 11 digits numbers from an alpha numeric string

    This works on the examples you provided:
    Please Login or Register  to view this content.
    Hope that helps,

    Colin

    RAD Excel Blog

  4. #4
    Registered User
    Join Date
    01-31-2011
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: How to extract one or two 11 digits numbers from an alpha numeric string

    Thank you very much for your prompt reply.
    Now please help me in getting only 11 digits numbers starting with 03.

  5. #5
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    1,252

    Re: How to extract one or two 11 digits numbers from an alpha numeric string

    I missed the fact that you only want to extract them if they start with 03. Doesn't brokenbiscuits formula do what you want?

  6. #6
    Registered User
    Join Date
    01-31-2011
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: How to extract one or two 11 digits numbers from an alpha numeric string

    Dear Colin
    you formula returns both numbers. I want only those 11 digits numbers that are starting with 03. Also if there are two 11 digit numbers in a cell starting with 03, I want the result in two different cells.
    I hope you can help.
    Thanks

  7. #7
    Registered User
    Join Date
    01-31-2011
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: How to extract one or two 11 digits numbers from an alpha numeric string

    Dear,
    How to get these numbers in two different cells.

  8. #8
    Registered User
    Join Date
    01-31-2011
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: How to extract one or two 11 digits numbers from an alpha numeric string

    Yes brokenbiscuit's formula worked. Now the only thing i want to know , if it is possible to get the two 11 digits numbers (if there are any) in two different cells.

  9. #9
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: How to extract one or two 11 digits numbers from an alpha numeric string

    =mid(a1,find(" 03",a1)+1,11)
    =if(iserror(mid(a1,find(" 03",a1,find(" 03",a1)+1)+1,11)),"",mid(a1,find(" 03",a1,find(" 03",a1)+1)+1,11))

  10. #10
    Registered User
    Join Date
    01-31-2011
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: How to extract one or two 11 digits numbers from an alpha numeric string

    Dear Brokenbiscuits
    I am sorry, I didn't get how to use these
    should I use both formulas in one cell or should I apply these on the results of earlier formula.
    Last edited by neo4u44; 11-16-2011 at 08:37 AM.

  11. #11
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: How to extract one or two 11 digits numbers from an alpha numeric string

    Use the first formula in one cell, and the second in another. The second formula will bring back a secondary number if there is one; if not it will return a blank.

  12. #12
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: How to extract one or two 11 digits numbers from an alpha numeric string

    Or,

    In B1 & copy DOWN.

    =IFERROR(MID(A1,FIND(" 03",A1)+1,11),"")

    C1, copy ACROSS & DOWN as much you need.

    =IFERROR(MID($A1,FIND(" 03",$A1,FIND(IF(B1="",9E+300,B1),$A1))+1,11),"")
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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