+ Reply to Thread
Results 1 to 6 of 6

Is there a formula to delete whole numbers but leave decimals?

  1. #1
    Registered User
    Join Date
    03-11-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    27

    Is there a formula to delete whole numbers but leave decimals?

    Hi all,

    I've got a spreadsheet that's basically a large list of numbers, both whole and decimal.
    For example, let's say this is in cells A1-A5:

    4
    0.65
    1.34
    3
    8.2

    Is there a formula to get rid of all of the whole numbers but leave the decimals?
    (What I mean by that is I don't need 4 or 3 as they're whole, but I need the decimals to be left alone)

    I know it's probably a really awkward question but I have over 2,000 lines to go through, it will take a long time to do manually.

    Perhaps if it's not possible to a formula to delete entries, maybe just make all whole numbers say something like "NO", so that I can sort the column in A-Z order and delete all of the 'NO's quickly by highlighting them all together.

    I hope that makes sense.

    Any help is appreciated!

    Thanks a lot

    Skye
    Last edited by Miss Molko; 04-22-2014 at 08:20 AM. Reason: Clarifying what I meant!

  2. #2
    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: Is there a formula to delete whole numbers but leave decimals?

    Here is a VBA solution

    Please Login or Register  to view this content.

    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    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

  3. #3
    Registered User
    Join Date
    03-11-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Is there a formula to delete whole numbers but leave decimals?

    Awesome!
    Thank you, I'll give this a try

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Is there a formula to delete whole numbers but leave decimals?

    Maybe something like:
    =IF(ISNUMBER(SEARCH(".",A2,1)),A2,"")
    depends a little on the format of your data, do you have things like 4.00? do you want to keep those? are there any numbers that are actually text strings?

  5. #5
    Registered User
    Join Date
    03-11-2014
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Is there a formula to delete whole numbers but leave decimals?

    All whole numbers don't have any decimals at all, they are just one digit.

    Thank you!!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,923

    Re: Is there a formula to delete whole numbers but leave decimals?

    Quote Originally Posted by Miss Molko View Post
    All whole numbers don't have any decimals at all, they are just one digit.

    Thank you!!
    Whole numbers can be represented as a single digit or a digit with decimal places: 4 and 4.00 are both the same, and both are whole numbers.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] Find and Delete all letters & leave numbers
    By Patish in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-06-2013, 08:11 AM
  2. Replies: 2
    Last Post: 03-22-2012, 01:35 PM
  3. Delete a rows values but leave formula and conditional formatting
    By BobTheRocker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-27-2010, 03:39 PM
  4. How to delete all the characters in cell and leave just the numbers?
    By yannipr in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-11-2008, 11:23 AM
  5. [SOLVED] Excel should allow delete cell's value but leave formula alone.
    By MrQuick in forum Excel General
    Replies: 7
    Last Post: 01-25-2006, 06:30 PM

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