+ Reply to Thread
Results 1 to 7 of 7

Custom Formatting a number to two digits regardless of lenght

  1. #1
    Registered User
    Join Date
    02-05-2014
    Location
    Fort Lauderdale
    MS-Off Ver
    Excel 2010
    Posts
    13

    Custom Formatting a number to two digits regardless of lenght

    Hi guys,

    I dont seem to find a post that solve this issue:

    Applying one custom formatting formula to a list of number in order to round them to the first two significant digits

    Example:

    1,428,932.0000 --- 1,400,000
    189,023.0000 --- 190,000
    60,345.0000 --- 60,000
    5,434.0000 --- 5,400
    985 --- 990
    57.24 --- 57
    7.345 --- 7.3
    etc

    Thank you!

  2. #2
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: Custom Formatting a number to two digits regardless of lenght

    Hi nangys,

    I don't think you can do this because you want to apply different rules to the same Column.

    You could use =MID(A1,1,2) but this would only give you the first 2 characters which isn't what you need ...
    Last edited by noboffinme; 02-20-2014 at 04:43 PM.
    Remember you are unique, like everyone else

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

    Re: Custom Formatting a number to two digits regardless of lenght

    I will be interested to see other's responses. Being a scientist, the best I have found is to use scientific/exponential notation: 0.0E+0. When I specifically don't want scientific notation (and most Excel users probably don't), I have not found a good formatting solution.

    I'm sure we could figure out a function solution that would be able to do this (maybe something like =VALUE(TEXT(A1,"0.0E+0")) that would convert the raw value to the desired rounded format.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,039

    Re: Custom Formatting a number to two digits regardless of lenght

    This will be a tough 1, because you dont just want the 1st 2 values shown, you also want them rounded

    This works for all but the last 1, working on that now...
    =MROUND(A1,10^(LEN(INT(A1))-2))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,039

    Re: Custom Formatting a number to two digits regardless of lenght

    OK if you format that to numbers, 2 decimal places (or 1), with thousand seperators, that works for all of them

  6. #6
    Registered User
    Join Date
    02-05-2014
    Location
    Fort Lauderdale
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Custom Formatting a number to two digits regardless of lenght

    Quote Originally Posted by FDibbins View Post
    This will be a tough 1, because you dont just want the 1st 2 values shown, you also want them rounded

    This works for all but the last 1, working on that now...
    =MROUND(A1,10^(LEN(INT(A1))-2))
    This formula seems to work pretty well for the tables that I'm using!!!

    Thank you so much guys for all your answers.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,039

    Re: Custom Formatting a number to two digits regardless of lenght

    Happy to help and thanks for the feedback

+ 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. [SOLVED] Conditional formatting if a number starts with specific digits
    By vshukla in forum Excel General
    Replies: 7
    Last Post: 01-23-2014, 12:43 PM
  2. [SOLVED] Custom Number formatting
    By schnol in forum Excel General
    Replies: 2
    Last Post: 06-19-2013, 01:32 PM
  3. Replies: 5
    Last Post: 08-02-2011, 03:08 AM
  4. Replies: 3
    Last Post: 02-12-2009, 01:08 PM
  5. [SOLVED] Number custom formatting
    By Don in forum Excel General
    Replies: 1
    Last Post: 06-24-2006, 10:40 PM

Tags for this Thread

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