+ Reply to Thread
Results 1 to 9 of 9

Is there a limit to the number of decimal places allowed in a formula?

  1. #1
    Registered User
    Join Date
    12-04-2014
    Location
    miami
    MS-Off Ver
    Professional
    Posts
    1

    Is there a limit to the number of decimal places allowed in a formula?

    I have never come across this before, but then maybe I never tried to be this precise. I am writing a formula that requires a very precise number (think Pi to 25 places), but it seems Excel is limiting the number of decimal places I can enter in the formula.

    Is this a known limitation, and is there a way to get around it?

    Thanks for any recommendations,

  2. #2
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: Is there a limit to the number of decimal places allowed in a formula?

    Perhaps:
    Please Login or Register  to view this content.
    Pete

  3. #3
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Is there a limit to the number of decimal places allowed in a formula?

    Goo afternoon miamianderson

    Excel can display up to 30 decimal places, but can only calculate to 15 significant figures.
    If you really need that kind of accuracy, then Excel may not be the right software for your purposes.

    https://en.wikipedia.org/wiki/Numeri...icrosoft_Excel

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Is there a limit to the number of decimal places allowed in a formula?

    Hi,

    Yes you're limited to 15 decimal places.

    Depending on what you're doing there might be some fancy way of slicing a text string of digit characters and manipulating the sub strings as if individually they were numerical decimals.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,375

    Re: Is there a limit to the number of decimal places allowed in a formula?

    Excel stores numbers as double precision floating point numbers, which means about 15 digits. So a solution like PetABC123 suggests will add a bunch of trailing 0s beyond what double precision allows. If you need more than 15 digits of precision, then you need something other than Excel.

    VBA has a "Decimal" data type that, I believe, will store numbers to about 28 digits https://msdn.microsoft.com/VBA/Langu...imal-data-type If that is enough precision, then you could store numbers as text in Excel, bring them into VBA, perform the calculations, then output the numbers back to Excel as text strings (otherwise Excel will convert them to double precision and you will lose the extra precision).

    Other programming languages have other data types (like Quad precision) that may allow even more precision.

    I am aware (but have never used) arbitrary precision algorithms. I have seen one example on this forum: https://www.excelforum.com/excel-pro...ith-excel.html but a resolution was never posted. The Wikipedia link may be useful: https://en.wikipedia.org/wiki/Arbitr...ion_arithmetic If you are allowed to use programming languages other than Excel/VBA, you should be able to find a programming language with an available library for these calculations that may save you developing your own procedures for implementing these algorithms.

    At this point, I would say that the big question is how much precision do you need?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,879

    Re: Is there a limit to the number of decimal places allowed in a formula?

    "the big question is how much precision do you need?" -- MrShorty
    I know that the question is directed toward the OP, however I thought that it might be of some help in making that determination to note that this NASA article states "For JPL's highest accuracy calculations, which are for interplanetary navigation, we use...pi rounded to the 15th decimal".
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  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,048

    Re: Is there a limit to the number of decimal places allowed in a formula?

    When all else fails, try multiplying the number by something like 10 000. Although excel will still only show 15 characters
    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

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Is there a limit to the number of decimal places allowed in a formula?

    Having spent years in analytical chemistry, wrestling with Measurement Uncertainty, I do struggle to envisage anything that justifies the use of 25 dps....
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Is there a limit to the number of decimal places allowed in a formula?

    Quote Originally Posted by Glenn Kennedy View Post
    Having spent years in analytical chemistry, wrestling with Measurement Uncertainty, I do struggle to envisage anything that justifies the use of 25 dps....
    An excellent point.

+ 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. Adusting decimal places based on greatest number of places in a series
    By anelson87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2022, 01:05 PM
  2. [SOLVED] Limit cell entry to two decimal places or whole number
    By amthyst826 in forum Excel General
    Replies: 8
    Last Post: 11-03-2017, 10:44 AM
  3. [SOLVED] Limit # of decimal places in file name
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2015, 03:45 PM
  4. [SOLVED] Need to limit the number of decimal places of a number in a text string
    By Turbo Dog in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-11-2013, 07:47 PM
  5. Limit Decimal Places in Formula Bar using VBA
    By nyt in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-26-2013, 03:10 PM
  6. custom data validation formula to limit cell value to maximum of 4 decimal places
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2009, 04:42 PM
  7. limit my number to 2 decimal places
    By Eee in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 12-19-2007, 09:12 AM

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