+ Reply to Thread
Results 1 to 9 of 9

Delete trailing zeros.

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Delete trailing zeros.

    I have a .csv file I imported. The numbers are 2.26751E+29. When I change them to Number this is what I get- 23461226400000500000000000000.00 With this series of numbers the highest number of digits is 16. I want to get rid of all the zeros after the 16th digit and the decimal and 2 digits. I haven't found the right combination to make this happen. I tried custom number with 16 zeros yet didn't get what I'm looking for. Below is what I want to accomplish.

    2346122640000050

    Thanks, in advance, for your help.

    Vivian

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Delete trailing zeros.

    hi Vivian, welcome to the forum. assuming data is in A1, this should help:
    =LEFT(A1,16)+0

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Delete trailing zeros.

    If you highlight your data then paste special >> divide >> 10000000000000 then you will get the needed result.

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Delete trailing zeros.

    Are all the numbers exactly the lenght of 2.26751E+29 as imported from the csv file? If not, divide by 10000000000000 will not work. The formula =LEFT(A1,16)+0 also does not work.

    For a detailed answer on numbers 15 digits and longer and how Excel handles it see this link:

    http://www.excelforum.com/excel-gene...s-convert.html
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Delete trailing zeros.

    Winnon is correct if the length differs from +29. try this, it seems to work, assuming your data is in A1...

    =SUBSTITUTE(A1,RIGHT(A1,2),16)+0

    @ Winnon. hoe gaan dit, waar in SA? im now in USA, grew up in PE, worked in carletonville and klerksdorp

    edit: make sure you format as number
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Registered User
    Join Date
    09-20-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Delete trailing zeros.

    Thanks for the help. After using the suggestion of FDibbins formula =SUBSTITUTE(A1,RIGHT(A1,2),16)+0 and reading your explanation I see that all my numbers can stop at 15 digits. Had to enlarge the font size to be able to accurately count them all.

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Delete trailing zeros.

    @ FDibbins,

    Now that is more like it, but.

    Actually the formula should be =SUBSTITUTE(A1,RIGHT(A1,2),15)+0 with the Cell/s containing the formula formatted to Number as you have stated, with the decimal set to "0". That will return what kasher is asking for, i.e.:
    Below is what I want to accomplish.

    2346122640000050
    @ FDibbins,

    Haai daar, ons het al gesels. Springs, naby Dunnottar, waar jou X gewoon het. Mooi bly!

  8. #8
    Registered User
    Join Date
    09-20-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Delete trailing zeros.

    Yeah, I caught that too and changed the formula to have 15 instead of 16. I appreciate your follow-up. Thanks.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Delete trailing zeros.

    thx for the catch guys. with so many 0's its hard to keep track lol

+ 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