+ Reply to Thread
Results 1 to 3 of 3

Excel 2003 and later - Formula to show decimals when a value has decimals

  1. #1
    Registered User
    Join Date
    01-25-2010
    Location
    Stafford, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Excel 2003 and later - Formula to show decimals when a value has decimals

    Hi there, I have a strange problem right now. It currently have a cell which is given a value that may or may not have decimals. Now if the value has decimals it need to round it up to two decimals points although if it only has 1 value after the decimal point it shouldn't add an extra 0. Example:

    Value with no decimals should show as:
    12
    Value with one decimals should show as:
    12.4
    Value with 2 decimals should show as:
    12.42
    And value with more then 2 decimals should show:
    12.42 (original being 12.4222221)

    I'm currently using the formate code: #,##0.## to achieve this, but when a value has no decimals it appears as 12. rather then 12

    If anyone knows how I could detect if the number has a decimal that would be great.

    I would also like to add, I tried to do something similar found in this article, (http://www.accountingweb.com/article...-part-1/222724). This is apparently new to 2007+ and wont work with 2003-, and the sheet has to be 2003- format because of compatibility with our clients (that's a debate I wouldn't want to enter)

    Thanks you - James

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,619

    Re: Excel 2003 and later - Formula to show decimals when a value has decimals

    Is the value result of the formula?
    If so, use format General for the cell and surround current formula with rounding, like:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    01-25-2010
    Location
    Stafford, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Excel 2003 and later - Formula to show decimals when a value has decimals

    This has seemed to fix the issue. Thank you!

+ 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. How to only show decimals if there are any
    By Myerse in forum Excel General
    Replies: 4
    Last Post: 04-20-2015, 03:58 PM
  2. [SOLVED] Show as many Decimals as Needed
    By FallingDown in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-17-2014, 08:52 AM
  3. Custom format to show decimals only when needed
    By Phalanxz in forum Excel General
    Replies: 8
    Last Post: 05-21-2014, 11:40 AM
  4. [SOLVED] 0;-0;;@ - format to show as two decimals places
    By johnmitch38 in forum Excel General
    Replies: 3
    Last Post: 09-05-2012, 09:34 AM
  5. Replies: 8
    Last Post: 08-15-2011, 10:12 AM

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