Article ID: 78113  View products that this article applies to. On This PageSummaryThis article discusses how Microsoft Excel stores and calculates floatingpoint numbers. This may affect the results of some numbers or formulas because of rounding or data truncation. OverviewMicrosoft Excel was designed around the IEEE 754 specification to determine how it stores and calculates floatingpoint numbers. IEEE is the Institute of Electrical and Electronics Engineers, an international body that, among other things, determines standards for computer software and hardware. The 754 specification is a very widely adopted specification that describes how floatingpoint numbers should be stored in a binary computer. It is popular because it allows floatingpoint numbers to be stored in a reasonable amount of space and calculations to occur relatively quickly. The 754 standard is used in the floatingpoint units and numeric data processors of nearly all of today's PCbased microprocessors that implement floatingpoint math, including the Intel, Motorola, Sun, and MIPS processors.When numbers are stored, a corresponding binary number can represent every number or fractional number. For example, the fraction 1/10 can be represented in a decimal number system as 0.1. However, the same number in binary format becomes the following repeating binary decimal:
0001100110011100110011 (and so on)
This can be infinitely repeated. This number cannot be represented in a finite (limited) amount of space. Therefore, this number is rounded down by approximately 2.8E17 when it is stored.However, there are some limitations of the IEEE 754 specification that fall into three general categories:
More informationMaximum/Minimum LimitationsAll computers have a maximum and a minimum number that can be handled. Because the number of bits of memory in which the number is stored is finite, it follows that the maximum or minimum number that can be stored is also finite. For Excel, the maximum number that can be stored is 1.79769313486232E+308 and the minimum positive number that can be stored is 2.2250738585072E308.Cases in which we adhere to IEEE 754
Cases in which we do not adhere to IEEE 754
PrecisionA floatingpoint number is stored in binary in three parts within a 65bit range: the sign, the exponent, and the mantissa.Collapse this table
The mantissa and the exponent are both stored as separate components. As a result, the amount of precision possible may vary depending on the size of the number (the mantissa) being manipulated. In the case of Excel, although Excel can store numbers from 1.79769313486232E308 to 2.2250738585072E308, it can only do so within 15 digits of precision. This limitation is a direct result of strictly following the IEEE 754 specification and is not a limitation of Excel. This level of precision is found in other spreadsheet programs as well. Floatingpoint numbers are represented in the following form, where exponent is the binary exponent:
X = Fraction * 2^(exponent  bias) Fraction is the normalized fractional part of the number, normalized
because the exponent is adjusted so that the leading bit is always a 1. This
way, it does not have to be stored, and you get one more bit of precision. This
is why there is an implied bit. This is similar to scientific notation, where
you manipulate the exponent to have one digit to the left of the decimal point;
except in binary, you can always manipulate the exponent so that the first bit
is a 1, because there are only 1s and 0s.Bias is the bias value used to avoid having to store negative exponents. The bias for singleprecision numbers is 127 and 1,023 (decimal) for doubleprecision numbers. Excel stores numbers using doubleprecision. Example using very large numbersEnter the following into a new workbook:A1: 1.2E+200 B1: 1E+100 C1: =A1+B1 Example using very small numbersEnter the following into a new workbook:A1: 0.000123456789012345 B1: 1 C1: =A1+B1 Correcting precision errorsExcel offers two basic methods to compensate for rounding errors: the ROUND function and the Precision as displayed or Set precision as displayed workbook option.Method 1: The ROUND functionUsing the previous data, the following example uses the ROUND function to force a number to five digits. This lets you successfully compare the result to another value.A1: 1.2E+200 B1: 1E+100 C1: =ROUND(A1+B1,5) This results in 1.2E+200. D1: =IF(C1=1.2E+200, TRUE, FALSE) This results in the value TRUE. Method 2: Precision as displayedIn some cases, you may be able to prevent rounding errors from affecting your work by using the Precision as displayed option. This option forces the value of each number in the worksheet to be the displayed value. To turn on this option, follow these steps.Excel 2003 and earlier versions
Excel 2007
Excel 2013 and Excel 2010
For example, if you choose a number format that shows two decimal places, and then you turn on the Precision as displayed option, all accuracy beyond two decimal places is lost when you save your workbook. This option affects the active workbook including all worksheets. You cannot undo this option and recover the lost data. We recommend that you save your workbook before you enable this option. Repeating binary numbers and calculations that have nearzero resultsAnother confusing problem that affects the storage of floating point numbers in binary format is that some numbers that are finite, nonrepeating numbers in decimal base 10, are infinite, repeating numbers in binary. The most common example of this is the value 0.1 and its variations. Although these numbers can be represented perfectly in base 10, the same number in binary format becomes the following repeating binary number when it is stored in the mantissa:
000110011001100110011 (and so on)
The IEEE 754 specification makes no special allowance for any number. It stores what it can in the mantissa and truncates the rest. This results in an error of about 2.8E17, or 0.000000000000000028 when it is stored.Even common decimal fractions, such as decimal 0.0001, cannot be represented exactly in binary. (0.0001 is a repeating binary fraction that has a period of 104 bits). This is similar to why the fraction 1/3 cannot be exactly represented in decimal (a repeating 0.33333333333333333333). For example, consider the following simple example in Microsoft Visual Basic for Applications:
Example: Adding a negative number
Example when a value reaches zero
Excel 97, however, introduced an optimization that attempts to correct for this problem. Should an addition or subtraction operation result in a value at or very close to zero, Excel 97 and later will compensate for any error introduced as a result of converting an operand to and from binary. The example above when performed in Excel 97 and later correctly displays 0 or 0.000000000000000E+00 in scientific notation. For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base: 172911
(https://support.microsoft.com/kb/172911/
)
Incorrect result raising 10 to very large/very small power214373 For more information about floatingpoint numbers and the IEEE 754 specification, please see the following World Wide Web sites:
(https://support.microsoft.com/kb/214373/
)
Incorrect result raising 10 to very large/very small power http://www.ieee.org
(http://www.ieee.org)
http://steve.hollasch.net/cgindex/coding/ieeefloat.html
(http://steve.hollasch.net/cgindex/coding/ieeefloat.html)
References For more information about how to work around these errors, click the following article number to view the article in the Microsoft Knowledge Base: 214118
(https://support.microsoft.com/kb/214118/
)
How to correct rounding errors in floatingpoint arithmeticNote This article also applies to Microsoft Excel for Mac for Office 365. PropertiesArticle ID: 78113  Last Review: July 29, 2015  Revision: 14.1 Applies to
Give Feedback 
