+ Reply to Thread
Results 1 to 3 of 3

Rounding decimals (...or custom number formatting?)

  1. #1
    Registered User
    Join Date
    09-21-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Question Rounding decimals (...or custom number formatting?)

    I have a spreadsheet that looks something like this:

    A B C D
    1 Item Number Sold Last Week Sold This Week Change
    2 1100256 968 2455 +153.62%
    3 1100257 28 49 +75%
    4 1100258 8 9 +12.5%
    5 1100259 7300 44 -99.4%

    The formula I'm using to get the value in column D is:

    =IF((((C2-B2)/B2)*100)>0,(CONCATENATE("+",(ROUND((((C2-B2)/B2)*100),2)),"%")),(CONCATENATE((ROUND((((C2-B2)/B2)*100),2)),"%")))

    How can I round the decimals to make sure all my numbers appear with two decimals? Since the formula uses CONCATENATE, I can't simply format the cells to show two decimals.

    I want it to look like this:


    A B C D
    1 Item Number Sold Last Week Sold This Week Change
    2 1100256 968 2455 +153.62%
    3 1100257 28 49 +75.00%
    4 1100258 8 9 +12.50%
    5 1100259 7300 44 -99.40%

    If you know a better way of doing this than the solution I'm asking for here, I'm all ears. I bet this might be much easier using custom number formatting. I'm just not well-versed in formatting abilities.
    Last edited by kitpierce; 05-13-2013 at 06:04 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,420

    Re: Rounding decimals (...or custom number formatting?)

    Try this:

    =IF(C2>B2,"+ ","- ")&TEXT(ABS(C2-B2)/B2*100,"0.00%")

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    09-21-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Rounding decimals (...or custom number formatting?)

    That is exactly what I was looking for. By putting the "0.00%" part in, it changed the decimal placement (percentages... ugh), though.

    I changed the formula that you gave me to this:

    =CONCATENATE((IF(C2>B2,"+ ","- ")&TEXT(ABS(C2-B2)/B2*100,"0.00")),"%")

    And it works perfectly.


    Thanks Pete!!

+ 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