Closed Thread
Results 1 to 8 of 8

Show decimal point only if not a whole number

  1. #1
    Registered User
    Join Date
    07-10-2006
    Posts
    18

    Show decimal point only if not a whole number

    I'd like to clean up the appearance of a spreadsheet by showing a decimal point only if the value is not a whole number, as well as limit the number of decimal places.

    Conditional formatting allows formulas to specify a condition, such as =A1=Int(A1), but I can't figure out how to specify a number format (instead of a color) as a result.

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    Use the command Format\Cells\Number. To do what you want, you should either select General format 0 which will give you exactly what is typed, or alternatively 0.### with one hash for each decimal place you want to display

    Matt

  3. #3
    CLR
    Guest

    RE: Show decimal point only if not a whole number

    Right-click > FormatCells > NumberTab > Custom > 0.## in the Type: window >
    Ok.........this will format to give a decimal point and no digits after for
    whole numbers and one to two decimal places max for those numbers with
    decimals.

    hth
    Vaya con Dios,
    Chuck, CABGx3

    "Exceler" wrote:

    >
    > I'd like to clean up the appearance of a spreadsheet by showing a
    > decimal point only if the value is not a whole number, as well as limit
    > the number of decimal places.
    >
    > Conditional formatting allows formulas to specify a condition, such as
    > =A1=Int(A1), but I can't figure out how to specify a number format
    > (instead of a color) as a result.
    >
    >
    > --
    > Exceler
    > ------------------------------------------------------------------------
    > Exceler's Profile: http://www.excelforum.com/member.php...o&userid=36221
    > View this thread: http://www.excelforum.com/showthread...hreadid=560141
    >
    >


  4. #4
    Registered User
    Join Date
    07-07-2010
    Location
    Toronto, Ontario
    MS-Off Ver
    Office 2010
    Posts
    1

    Re: Show decimal point only if not a whole number

    Is their a format for showing only a decimal point when the number is not whole and also hide zeros?

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Show decimal point only if not a whole number

    @rharor
    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    Ben Van Johnson

  6. #6
    Registered User
    Join Date
    04-22-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Show decimal point only if not a whole number

    I use Office 2003.

    If I use the code suggested below [FormatCells > NumberTab > Custom > 0.##]... a number such as "88.25" displays correctly -
    BUT if the number becomes "88" (as a result of a formula calculation) then the display becomes "88." (The decimal point SHOWS, even though the trailing zeros don't)

    So, the suggested solution does not really work.

    I COULD keep the 'Number Format' as 'General' - that way a number WITHOUT decimal figures would show as "88" - and when it acquires a decimal value, it would show as "88.25"...

    But actually, I want to set up a CUSTOM FORMAT... where:-
    "88" would show as "88 Man-Days" (#0" Man-Days")
    "88.25" would show as "88.25 Man-Days" (#0.##" Man-Days")

    Is there any way of doing that?


    Quote Originally Posted by CLR View Post
    Right-click > FormatCells > NumberTab > Custom > 0.## in the Type: window >
    Ok.........this will format to give a decimal point and no digits after for
    whole numbers and one to two decimal places max for those numbers with
    decimals.

    hth
    Vaya con Dios,
    Chuck, CABGx3

    "Exceler" wrote:

    >
    > I'd like to clean up the appearance of a spreadsheet by showing a
    > decimal point only if the value is not a whole number, as well as limit
    > the number of decimal places.
    >
    > Conditional formatting allows formulas to specify a condition, such as
    > =A1=Int(A1), but I can't figure out how to specify a number format
    > (instead of a color) as a result.
    >
    >
    > --
    > Exceler
    > ------------------------------------------------------------------------
    > Exceler's Profile: http://www.excelforum.com/member.php...o&userid=36221
    > View this thread: http://www.excelforum.com/showthread...hreadid=560141
    >
    >

  7. #7
    Registered User
    Join Date
    04-09-2014
    Location
    New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    56

    Re: Show decimal point only if not a whole number

    Select CUSTOM FORMAT still needs to be general not number i.e. [General "Man-Days"]

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Show decimal point only if not a whole number

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

Closed 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