+ Reply to Thread
Results 1 to 4 of 4

extracting a string of digits

  1. #1
    Registered User
    Join Date
    01-28-2009
    Location
    New York, USA
    MS-Off Ver
    Excel 2007
    Posts
    46

    extracting a string of digits

    I have a column of identifying numbers that have a range of numbers and letters. There is a string of 5 numbers in a row that I need to extract into a separate column however the location of these 5 digits sometimes vary. example of the numbers listed below and the 5 digits i need to extract are underlined. The 5 numbers are either at the end of the text string or it's sandwiched between two varying letters. Is there some form or left/mid/right formula I can use to separate?

    07W40395
    7J37035
    7J37335N
    07W40345
    07W40605
    03V34675X
    01V35255Z
    07W40315N

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,637

    Re: extracting a string of digits

    Assuming your data is in D1 use this:

    Confirmed with ctrl+shift+enter (not just enter).

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: extracting a string of digits

    Try this

    =LOOKUP(10^308,--MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&1/17,3)),ROW(A$1:A$10000)))

    Row\Col
    A
    B
    1
    07W40395
    40395
    2
    7J37035
    37035
    3
    7J37335N
    37335
    4
    07W40345
    40345
    5
    07W40605
    40605
    6
    03V34675X
    34675
    7
    01V35255Z
    35255
    8
    07W40315N
    40315
    Last edited by AlKey; 03-16-2015 at 08:48 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Registered User
    Join Date
    01-28-2009
    Location
    New York, USA
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: extracting a string of digits

    Both options work well but given the size of the spreadsheet the array formula works better as it doesn't freeze up my system. Thanks so much!

+ 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. VBA code for extracting last three digits from alphanumeric string.
    By klantacook in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-01-2013, 05:30 PM
  2. [SOLVED] extracting digits only from column with letters and digits
    By Jayne in forum Excel General
    Replies: 11
    Last Post: 08-20-2012, 10:38 PM
  3. [SOLVED] Extracting Text from a string of Text & Digits of variable length
    By hastex in forum Excel General
    Replies: 6
    Last Post: 06-06-2012, 09:11 AM
  4. Extracting last four digits
    By t2true in forum Excel General
    Replies: 2
    Last Post: 11-17-2006, 05:58 PM
  5. Extracting first two digits of a time entry!!
    By roshinpp_77 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-08-2006, 08:35 AM

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