+ Reply to Thread
Results 1 to 2 of 2

Getting rid of leading and trailing 0's and decimal points for whole numbers

  1. #1
    Registered User
    Join Date
    02-21-2011
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2010
    Posts
    2

    Getting rid of leading and trailing 0's and decimal points for whole numbers

    I have a question concerning formatting a cell to not show trailing zero's or leading zero's. For instance if I have the following numbers: 8, 1.62, .42 I want them listed as shown. The 8 should not have a decimal, the 1.62 is fine, and the .42 should not have a leading 0. How can I do this? I have tried multiple ways including the following: [=0]0;[>1]0;#.### which works for whole number and the number 0 and number lest then 1 but not for partial numbers greater than 1 such as the above example for 1.62. For the number 1.62 it would round it up to 2.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Getting rid of leading and trailing 0's and decimal points for whole numbers

    I think that's as close as you'll get.
    Entia non sunt multiplicanda sine necessitate

+ 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