+ Reply to Thread
Results 1 to 11 of 11

Extract the integer

Hybrid View

  1. #1
    Registered User
    Join Date
    10-17-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Extract the integer

    Greetings,

    Below is a snapshot of data in a column. I need a way to extract the number, may be a whole, may be decimal, and leave behind the text description. Result to be put into a new column:

    Hernia Umbilical 553.1
    Perirectal Abscess 566
    Diverticulitis 577.0
    553.21 Hernia Vental/Incisional
    Abdominal Pain RUQ789.01
    Abdominal Pain RLQ789.03
    217: Benign Breast mass
    541-appendicitis
    Chronic 575.11 Cholecystitis
    SBO560.81
    786.05SOB
    226/ Thyroid neoplasm

    The idea here is that the integer could be integrated in anyway imaginable with the associated text. I don't need the text. The end result must display this in a new column:

    553.1
    566
    577.0
    553.21
    789.01
    789.03
    217
    541
    575.11
    560.81
    786.05
    226

    I am not technical with Excel at all, so please be gentle.

    Thanks
    Camil Sader, MD

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How do you extract the integer

    If we assume your strings are in A1:A12 and you want the numbers extracted to B1:B12

    B1: 
    =LOOKUP(9.99E+307,--MID(SUBSTITUTE(A1,":","@"),MIN(FIND({1,2,3,4,5,6,7,8,9,0},A1&1234567890)),ROW(A$1:INDEX(A:A,LEN(A1)))))
    copied down to B12
    (above approach c/o Richard Schollar)

  3. #3
    Registered User
    Join Date
    10-17-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How do you extract the integer

    Mr. Ote

    You are a genius. It works very well. That is exactly what I needed but I need you to test your formula on this:

    Hernia Uni 550.90

    I want the output to be 550.90 and not 550.9

    Possible?
    Camil Sader, MD

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How do you extract the integer

    Change the number format of the cell containing the result to 2 decimal places.
    (press CTRL + 1 to bring up the format cell dialog, click Number tab (if not active by default), choose Number and set decimal places as appropriate - use thousand operator is also optional)

  5. #5
    Registered User
    Join Date
    10-17-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: How do you extract the integer

    Sounded great till I did it. There is a conflict. Watch this:

    Hernia 550.90 is in A1
    I need 550.90 extracted
    550.9 gets extracted into B1
    Change the decimal to 2
    You get 550.90
    Great!

    The conflict:
    Delete the A1 cell and enter:
    Rectal Abscess 566
    I need 566 extracted
    566.00 gets extracted into B1
    566.00 is an invalid code for medical billing (no such code)
    Therefore there is a huge difference between 566 and 566.00
    That's a difference between getting the claim paid vs. rejected.
    Have I made you say 'uncle' yet?

    Camil Sader, MD

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: How do you extract the integer

    If you need the numeric values returned as text strings (ie as they were) then append the formula with &""

    =LOOKUP(9.99E+307,--MID(SUBSTITUTE(A1,":","@"),MIN(FIND({1,2,3,4,5,6,7,8,9,0},A1&1234567890)),ROW(A$1:INDEX(A:A,LEN(A1)))))&""
    edit: ignore that ... I will look at this later this evening if not resolved in the meantime by another kind soul.

  7. #7
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: How do you extract the integer

    Far less elegant than Don's/Richard's formula, but it seems to handle the ".90" problem.
    Attached Files Attached Files

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: How do you extract the integer

    i gave up when i saw
    Rectal Abscess 566
    no no no to much info
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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