+ Reply to Thread
Results 1 to 6 of 6

Number Format With Fixed Number Of Digits

  1. #1
    Registered User
    Join Date
    03-23-2010
    Location
    Lausanne, Switzerland
    MS-Off Ver
    O365
    Posts
    22

    Number Format With Fixed Number Of Digits

    Hi!

    How shall I determine the number format to have it fixed independently of where the comma is?
    I would do like to have all the cells with 6 digits as follows:
    123456
    12345.6
    1234.56
    123.456
    12.3456
    1.23456
    0.12345
    0.01234
    0.00123
    0.00012
    0.00001

    Many thanks,

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Number Format With Fixed Number Of Digits

    -----------
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Number Format With Fixed Number Of Digits

    Hello,

    all the numbers of your sample will behave like that with the General format.

    Is this really your question? Or do you need to shorten numbers with more than 6 digits to only 6 digits?

    cheers, teylyn

  4. #4
    Registered User
    Join Date
    03-23-2010
    Location
    Lausanne, Switzerland
    MS-Off Ver
    O365
    Posts
    22

    Re: Number Format With Fixed Number Of Digits

    Hi Teylyn,

    Thank you for your reply and sorry for not being precise enough.

    My numbers can have more than six digits (however never before the comma).
    for example:
    123.521456874 should show: 123.521
    1.25879632124 should show: 1.25880
    58743.2158795 should show: 58743.2
    0.02598763527 should show: 0.02599
    65.5875135843 should show: 65.5875
    432879.012587 should show: 432879
    ...

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Number Format With Fixed Number Of Digits

    Hi again,

    you could use a formula like

    =TRUNC(A1,6-LEN(INT(A1)))

    This will truncate the number.

    Or you could use six conditional formats that test how many digits are in front of the decimal point. The conditions and custom formats are listed below. Note that these will round the number, not just cut off the remaining decimals.



    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-23-2010
    Location
    Lausanne, Switzerland
    MS-Off Ver
    O365
    Posts
    22

    Re: Number Format With Fixed Number Of Digits

    Hi Teylyn,
    I worked perfectly with the conditional formatting, the trunc function made the formulas unclear.
    Thank you very much!

+ 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. Formula to copy a number from a cell and make the number fixed
    By Brycker in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-29-2015, 01:59 PM
  2. Check most frequent number in 1 column that has 4 digits number
    By Merson78 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-07-2014, 10:57 PM
  3. [SOLVED] Define a range of fixed number of columns, but unlimited number of rows
    By ccopac in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-22-2012, 02:23 PM
  4. Replies: 4
    Last Post: 09-16-2012, 10:26 AM
  5. Replies: 3
    Last Post: 02-12-2009, 01:08 PM
  6. [SOLVED] Addding a Random number to a fixed number.....
    By Dermot in forum Excel General
    Replies: 6
    Last Post: 08-20-2006, 07:20 AM
  7. [SOLVED] How do I format cells to a specific number of digits?
    By Gabriele in forum Excel General
    Replies: 3
    Last Post: 02-05-2005, 12:06 PM

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