+ Reply to Thread
Results 1 to 4 of 4

Show final decimal place digit when it is zero?

  1. #1
    Registered User
    Join Date
    04-21-2004
    Posts
    5

    Show final decimal place digit when it is zero?

    I have a feeling that the answer to this question might be embarrassingly simple, but I can't find the answer so here goes...

    I would like to generate a result which will be shown to the same number of decimal places as the original figure, even where the final decimal place digit is a zero. For example, in the calculation 87.30 + 0.10 = 87.40 I would like the zeroes at the end of 87.30 and 87.40 to be shown on the worksheet.

    I cannot simply format the result cells to display a fixed number of decimal places because the required number of decimal places varies depending on the input number. For example, a starting number of 1.7640 will always require a result to be shown to 4 decimal places, but an input figure of 87.20 will require that the result be shown to 2 decimal places.

    I can get the input number to show correctly if I format the cell as Text. However, I have not been able to find a way to show the result to the required number of decimal places when the final decimal place digit is zero. For example, if the contents of cells are as follows;

    Cell A1
    87.30

    Cell A2
    0.10

    Cell A3
    =A1+A2

    This would yield the result 87.4 in Cell A3, but I would like it to appear as 87.40.

    Can anyone tell me how I can achieve this?

    Thanks.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    format the cells Number to be Number with 2 decimal places.

    guess I should have read ALL of your post
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    A3: =text(a1+a2,"0."&rept("0",len(a1)-find(".",a1)))

  4. #4
    Registered User
    Join Date
    04-21-2004
    Posts
    5
    Quote Originally Posted by Andy Pope View Post
    A3: =text(a1+a2,"0."&rept("0",len(a1)-find(".",a1)))
    Great - that solves my problem.

    Thanks for your help.

+ 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. SpellNumber for Three Decimal Place Percentages?
    By karixana in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2015, 07:09 PM
  2. just sum 3 decimal places and not whole #
    By armyguy in forum Excel General
    Replies: 2
    Last Post: 05-16-2008, 05:02 AM
  3. Numbers round down when a 5 is in the third decimal place using a formula
    By Jbagger in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-27-2007, 11:59 AM
  4. setting number to one decimal place with formula
    By caliskier in forum Excel General
    Replies: 1
    Last Post: 01-17-2007, 06:54 PM
  5. how to show two decimal points
    By associates in forum Excel General
    Replies: 3
    Last Post: 10-12-2006, 04:11 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