+ Reply to Thread
Results 1 to 6 of 6

Conditional formatting remove decimal on percent when round number

  1. #1
    Registered User
    Join Date
    01-14-2019
    Location
    Montreal, Canada
    MS-Off Ver
    Office 2007
    Posts
    15

    Conditional formatting remove decimal on percent when round number

    Is there a formula I can use to remove the decimals when using percentages if the number is round?

    I'm looking to have 2 decimals, but to remove them if the number is round.

    Ex.

    1 = 100%
    0.75 = 75%
    0.5 = 50%

    But

    0.165 = 16.5%
    0.8454 = 85.54%

    How can I achieve this?

    Thanks

  2. #2
    Registered User
    Join Date
    08-24-2014
    Location
    Swansea
    MS-Off Ver
    Office 365
    Posts
    99

    Re: Conditional formatting remove decimal on percent when round number

    Hi Veeejay,
    I am not sure I quite understand what you are after but if you are trying to get just 1 number after the decimal this would work, assuming the number you are trying to round is in A1:
    =ROUND(A1,1)
    thanks
    Leigh

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Conditional formatting remove decimal on percent when round number

    Condition formula number-MOD(number,0.01)=number should be able to detect when your number is an integer percent (unless floating point errors become a problem).
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Conditional formatting remove decimal on percent when round number

    Use as CF formula

    Please Login or Register  to view this content.
    and set format to % with 0 decimals

    applied range should start at A1 for this formula

  5. #5
    Registered User
    Join Date
    01-14-2019
    Location
    Montreal, Canada
    MS-Off Ver
    Office 2007
    Posts
    15

    Re: Conditional formatting remove decimal on percent when round number

    But this will remove all decimals.
    I'm still looking to get up to two decimals, only when they exists and not x.00%

    The reasoning is that with large number set the .00% makes it really hard to read.

    EDIT: Sorry it was doing a weird thing but I got it to work!
    Thanks
    Last edited by veeejay; 02-06-2019 at 04:07 PM.

  6. #6
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Conditional formatting remove decimal on percent when round number

    Eventhough the main question is solved. I put some experiments with several floating format options in the attached sheet. Just thought it might be usefull to share the experiment.

    in col B there is 4 CF rules set up to show no, 1, 2 or 3 decimals, not that the order of CF is crucial for it to work properly.

    in Col D there is format mask, 0,???% this will align percentages on decimal and show 0-3 decimals depending on outcome, the whole percentages look strange due to decimal separator being visable also the reading with spaces can take some getting used to

    in Col F there is a format mask 0,###% this will also show 0-3 decimals depending on outcome but, it has the same problem as the above, the decimal separator stays visible on whole numbers

    in Col H I is the same format as col F but put in a CF for the whole numbers.

    (be aware that my system is setup to use comma as decimal separator, for some countries you may need to setup your own custom formats to use point as decimal separator instead)
    Attached Files Attached Files

+ 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. Replies: 13
    Last Post: 12-18-2015, 03:39 PM
  2. [SOLVED] Formatting Text Box to Percent from Decimal
    By esaban in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-22-2014, 04:49 PM
  3. [SOLVED] Round off numbers and remove decimal points
    By bmbalamurali in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-08-2014, 01:14 PM
  4. [SOLVED] number formatting - conditional decimal point
    By Ric in forum Excel General
    Replies: 6
    Last Post: 10-18-2005, 07:05 PM
  5. [SOLVED] Formatting a number to look like a Percent without a percent sign
    By David Iacoponi in forum Excel General
    Replies: 2
    Last Post: 09-15-2005, 02:05 PM
  6. [SOLVED] How do I round last number without a decimal point
    By rollover22 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  7. [SOLVED] How do I round last number without a decimal point
    By rollover22 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 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