+ Reply to Thread
Results 1 to 5 of 5

extracting numbers from a string of text and numbers

  1. #1
    Registered User
    Join Date
    03-05-2013
    Location
    Boston, USA
    MS-Off Ver
    Excel 2010
    Posts
    38

    extracting numbers from a string of text and numbers

    Hi guys,
    I am stumped here. I am trying to pull out the numbers from a column that contains text and numbers. The text are serial numbers, and the number part in sandwiched between two clumps of text. However, these clumps of text on either side are not always the same size so just using the =mid function doesnt seem to be working, unless I can tell it to start when it sees the first number, which I can't figure out. The # i am trying to get is sometimes 3 and sometimes 4 numbers long.

    Example:

    MT411BY
    MX623AB
    WA460WGL
    U420BS
    CM1700GA
    H710LOCO
    M365WT

    I would like a column next to this one to read

    411
    623
    460
    1700
    710
    365

    Can anyone help with this?

    Thanks

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: extracting numbers from a string of text and numbers

    Hi

    Try this, copied down...
    =LOOKUP(99^99,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),ROW($1:$10000)))) Courtesy of:*Ron Coderre
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: extracting numbers from a string of text and numbers

    Look at this site for a couple of solutions

    http://chandoo.org/wp/2012/06/19/ext...om-text-excel/
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    03-05-2013
    Location
    Boston, USA
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: extracting numbers from a string of text and numbers

    Ron you are a saint.

  5. #5
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: extracting numbers from a string of text and numbers

    suppose that ytour data in a1 cell

    =VALUE(MID(A1,MATCH(TRUE,ISNUMBER(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)*1),0),SUM(--(ISNUMBER(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)*1)))))

    ctrl+shift+enter

    then drag it down
    Appreciate the help? CLICK *

+ 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