Results 1 to 4 of 4

Thread: Extract numbers from alphanumeric values

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    3
    Rep Power
    0

    Extract numbers from alphanumeric values

    Thanks for the help!
    Basically, what I'm looking for is i have a string value: 0few321make876many
    I want to extract only numerical values from the string by excel formula only like 0321876.
    Please help

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Hi

    try this

    =TEXT(SUMPRODUCT(MID(0&A2,LARGE(INDEX(ISNUMBER(--MID(A2,ROW($1:$25),1))*
    ROW($1:$25),0),ROW($1:$25))+1,1)*10^ROW($1:$25)/10),REPT("0",COUNT(--MID(A2,ROW($1:$25),1))))

    I modified the formula which I got from here.

    It's an array formula. Confirmed with CTRL + SHIFT + ENTER.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  3. #3
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    ..and here is a non array formula

    =TEXT(SUMPRODUCT(MID(0&A2,LARGE(INDEX(ISNUMBER(--MID(A2,ROW($1:$25),1))*
    ROW($1:$25),0),ROW($1:$25))+1,1)*10^ROW($1:$25)/10),REPT("0",COUNT(INDEX(--MID(A2,ROW($1:$25),1),0,0))))
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  4. #4
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    13
    The link Admin posted is too long for me to go through now, but I don't think the following was posted there (if it was, I am sorry for the repeat)...

    Posted previously by Lars-Åke Aspelin (in an old newsgroup)...

    =MID(SUMPRODUCT(--MID("01"&A1,SMALL((ROW($1:$300)-1)*ISNUMBER(-MID("01"&A1,ROW($1:$300),1)),ROW($1:$300))+1,1),10 ^(300-ROW($1:$300))),2,300)

    This is an array formula and has to be confirmed with CTRL+SHIFT+ENTER rather than just ENTER.

    It has the following (known) limitations:

    - The input string in cell A1 must be shorter than 300 characters

    - There must be at most 14 digits in the input string.
    (Extra digits will be shown as zeroes.)

    Maybe of no practical use, but it will also handle the following two cases correctly:

    - a "0" as the first digit in the input will be shown correctly in the output

    - an input without any digits at all will give the empty string as output (rather than 0).

Similar Threads

  1. Extract Number From Alphanumeric Text
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 10
    Last Post: 09-11-2013, 10:14 PM
  2. Replies: 14
    Last Post: 05-25-2013, 06:55 AM
  3. Replies: 2
    Last Post: 03-21-2013, 08:51 PM
  4. Extracting Numeric Values From Alphanumeric Text
    By Safal Shrestha in forum Excel Help
    Replies: 3
    Last Post: 03-21-2013, 12:04 PM
  5. VBA Function To Extract Decimal Numbers
    By PcMax in forum Excel Help
    Replies: 7
    Last Post: 11-19-2011, 09:42 PM

Posting Permissions

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