+ Reply to Thread
Results 1 to 8 of 8

Leave only decimal numbers in a cell

  1. #1
    Registered User
    Join Date
    06-08-2012
    Location
    Liverpool
    MS-Off Ver
    Office 365
    Posts
    84

    Leave only decimal numbers in a cell

    I need to remove text from either the beginning or the end of a cell, leaving only a decimal number.

    For example I would like the following values -
    USD53.76 NAV
    £14.2725XD
    £1.467 NAVXD
    £3.27469 DHLXD
    EUR10.466 NAV

    To equal -
    53.76
    14.2725
    1.467
    3.27469
    10.466

    I have tried to remove all text, but this also removes the decimal point and I need to keep that.

    Unfortunately I can't upload a sample sheet, as restrictions at work will not allow it.

    I am using Excel 2007.

    Any ideas?

    Thanks,

    Sun

  2. #2
    Forum Contributor
    Join Date
    05-29-2013
    Location
    MD
    MS-Off Ver
    Excel 365
    Posts
    148

    Re: Leave only decimal numbers in a cell

    Hi Sun,

    Create a new module and paste this code into it:

    Please Login or Register  to view this content.
    Now use the formula =GETNUMBER([cell]) to extract the number and decimal from the cell.

    Thanks
    Duncan

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Leave only decimal numbers in a cell

    Copy your data into Word and use the Replace feature.

    Enter[A-Z,a-z] in the Find field and leave the replace with field blank. Select Use Wildcards. Click Replace All. This will replace all alpha characters with nothing.

    Copy the results back to Excel.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  4. #4
    Registered User
    Join Date
    06-08-2012
    Location
    Liverpool
    MS-Off Ver
    Office 365
    Posts
    84

    Re: Leave only decimal numbers in a cell

    Quote Originally Posted by duncandhu View Post
    Hi Sun,

    Create a new module and paste this code into it:

    Please Login or Register  to view this content.
    Now use the formula =GETNUMBER([cell]) to extract the number and decimal from the cell.

    Thanks
    Duncan
    Duncan, that is perfect!

    I can't tell you how many hours of head scratching you've just saved me!

    Many, many thanks.

    Sun

  5. #5
    Registered User
    Join Date
    06-08-2012
    Location
    Liverpool
    MS-Off Ver
    Office 365
    Posts
    84

    Re: Leave only decimal numbers in a cell

    Newdoverman, that's what I call thinking outside of the box! Good solution, thanks.

    Sun

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Leave only decimal numbers in a cell

    You're welcome.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Leave only decimal numbers in a cell

    Other method and capable to handle negative number

    =GetNumber(A1)

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-08-2012
    Location
    Liverpool
    MS-Off Ver
    Office 365
    Posts
    84

    Re: Leave only decimal numbers in a cell

    Thanks Jindon. Loving the help here!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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