+ Reply to Thread
Results 1 to 6 of 6

pulling out 12 digit number from an alphanumeric string

  1. #1
    Registered User
    Join Date
    09-18-2013
    Location
    Luton
    MS-Off Ver
    Excel 2003
    Posts
    3

    Question pulling out 12 digit number from an alphanumeric string

    Trying to pull out a number from a load of alphanumeric characters.

    Example of the cell data: Boundary Walls Replaced 2007-08 Gates and Shed Doors Renewed 2008-09; Referenced from 100012345678 Re-roofing 2001.

    Issue is that there are several numbers in the cell and I only need the 12 digit number, in the example above I need the 10012345678 number extracted. I have 2500 lines of data and each line has a different 12 digit number in different places within the cell. I have tried several array formulas I've found on this site however they find the first number in this case 2007 and also bring back text.

    I'd appreciate any help on this

    Thanks
    Sue

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: pulling out 12 digit number from an alphanumeric string

    Do any of the number strings of interest start with leading zeros?

    003456789012
    023456789012
    000456789012
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    09-18-2013
    Location
    Luton
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: pulling out 12 digit number from an alphanumeric string

    Hi Tony

    they either start with
    1000******** or
    2000********
    there are no leading zeros

    Hope you can help

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: pulling out 12 digit number from an alphanumeric string

    Try this array formula**:

    =MAX(IF(ISNUMBER(--MID(A2,ROW(INDIRECT("1:"&LEN(A2))),12)),--MID(A2,ROW(INDIRECT("1:"&LEN(A2))),12)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Format as Number, 0 decimal places

    Assumes there will not be other number strings longer than 12 digits.

  5. #5
    Registered User
    Join Date
    09-18-2013
    Location
    Luton
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: pulling out 12 digit number from an alphanumeric string

    Tony that works a treat... many many thanks


  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: pulling out 12 digit number from an alphanumeric string

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to add check digit to 6 digit number string...
    By unclejemima in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-18-2013, 04:19 PM
  2. Replies: 12
    Last Post: 03-20-2013, 05:46 PM
  3. Replies: 6
    Last Post: 05-21-2012, 04:07 PM
  4. Extract number from alphanumeric string
    By laichiwai in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-12-2010, 01:40 AM
  5. Extract number from alphanumeric string
    By shiner99 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-16-2008, 03:30 PM

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