+ Reply to Thread
Results 1 to 5 of 5

Deleting to the right of the period or decimal.

  1. #1
    Forum Contributor
    Join Date
    10-16-2012
    Location
    Brooklyn
    MS-Off Ver
    Excel 2010 PC
    Posts
    137

    Deleting to the right of the period or decimal.

    I have a column full of numbers. Some of the numbers have periods at the end, and are followed by more numbers or letters. Is there a macro to delete that period and everything to the right of it?

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Deleting to the right of the period or decimal.

    If your column full of numbers is in A1:Axxx, put this in B1 and fill down:

    =LEFT(A1,FIND(".",A1)-1)+0

    That will return the text left of the decimal and convert it to a number. if you want to leave it as a text string, then remove the +0 at the end of the formula.

    - Moo
    Last edited by Moo the Dog; 12-21-2012 at 02:06 PM.

  3. #3
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Deleting to the right of the period or decimal.

    Probably should add an error wrapper around that function just in case a cell in column A doesn't have a decimal. Change the formula to:

    =IFERROR(LEFT(A1,FIND(".",A1)-1),A1)+0

    - Moo

    Note: The only reason I am using the LEFT function is because you said there may be letters to the right of the decimal. If your data only contained numbers (only numbers on both sides of the decimal) then you could just use =INT(A1).

    Life is much easier when letters and numbers don't mix.
    Last edited by Moo the Dog; 12-21-2012 at 02:16 PM. Reason: Added note.

  4. #4
    Forum Contributor
    Join Date
    10-16-2012
    Location
    Brooklyn
    MS-Off Ver
    Excel 2010 PC
    Posts
    137

    Re: Deleting to the right of the period or decimal.

    Thanks MOO. This formula works well.

  5. #5
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Deleting to the right of the period or decimal.

    Glad to help.

    - Moo

+ 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