+ Reply to Thread
Results 1 to 6 of 6

extract numbers in a cell containing alphanumeric data

  1. #1
    Registered User
    Join Date
    11-08-2011
    Location
    KSA
    MS-Off Ver
    Excel 2007
    Posts
    93

    extract numbers in a cell containing alphanumeric data

    Let say

    Column A

    I21.4 Acute subendocardial myocardial infarction
    I21.0 Acute transmural myocardial infarction of anterior wall
    I21.4 Acute subendocardial myocardial infarction
    I21.0 Acute transmural myocardial infarction of anterior wall

    I want to put the numeric values in column B

  2. #2
    Valued Forum Contributor
    Join Date
    04-09-2013
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: extract numbers in a cell containing alphanumeric data

    Hi,

    Can you post some more data or it will be always of same type starting with I?

    Regards,

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: extract numbers in a cell containing alphanumeric data

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


    will work for any prefix (I, or multiple letters, or with spaces after the letter) and will return the "number as displayed" i.e. 21.0. It will also work with more complex "numbers", like 21.4.4 and will display that.

    BUT... it MUST have a space after the number...
    Last edited by Glenn Kennedy; 11-09-2014 at 04:55 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: extract numbers in a cell containing alphanumeric data

    Less of a monster, but one which must be array entered (CTRL + SHIFT + ENTER) and which also falls over if there's no space after the last digit
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    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: extract numbers in a cell containing alphanumeric data

    A little bit shorter non-array formula

    =--MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&1234567890)),FIND(" ",A1)-MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&1234567890)))

    Row\Col
    A
    B
    1
    I21.4 Acute subendocardial myocardial infarction
    21.4
    2
    I21.0 Acute transmural myocardial infarction of anterior wall
    21
    3
    I21.4 Acute subendocardial myocardial infarction
    21.4
    4
    I21.0 Acute transmural myocardial infarction of anterior wall
    21
    5
    werwr25.045 werwr
    25.045
    6
    poipoipopi35.256 test,test
    35.256
    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

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: extract numbers in a cell containing alphanumeric data

    If the referenced text will ALWAYS begin with a letter, a number, and a space
    this regular formula returns the value between the letter and the first space:
    Please Login or Register  to view this content.

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

+ 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. [SOLVED] Extract numbers from a string of alphanumeric text
    By Joshdm0716 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-09-2014, 08:28 PM
  2. Extract numbers from a alphanumeric cell
    By cpgscotcher in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-01-2013, 04:10 PM
  3. how do i extract numbers from alphanumeric file name?
    By LonesomeTwin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-08-2011, 06:03 AM
  4. [SOLVED] Function to extract numbers from an alphanumeric cell
    By diana in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-13-2006, 06:00 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