Article ID: 269370 - View products that this article applies to.
Expand all | Collapse all

Symptoms

When you type a number that contains more than 15 digits in a cell, Microsoft Excel changes any digits past the fifteenth place to zeroes. For example, if you attempt to type a credit card ID number in the following format  
####-####-####-####
Excel changes the last digit to a zero.

Cause

Excel follows the IEEE 754 specification on how to store and calculate floating-point numbers. Excel therefore stores only 15 significant digits in a number, and changes digits after the fifteenth place to zeroes. 

Workaround

To work around this behavior, format the cell as text, then type the numbers. The cell can then display up to 1,024 characters. 

More information

This behavior only occurs with numbers that are intended for calculation, that is, in cells that are formatted as numbers. In cells that are formatted as text, you can type up to 32,767 characters, of which Excel displays up to 1,024 characters on the worksheet.

Because custom number formats are designed to work primarily with numbers, you cannot create a custom number format that stores more than 15 digits. For example, you cannot use the following format to store a 16-character credit card ID as a number: 
####-####-####-####
If you type the number 1111222233334444 in a cell that uses the ####-####-####-#### format, Excel displays 1111-2222-3333-4440 in the cell. The actual number that you are attempting to store is 1,111,222,233,334,444, which is over one quadrillion. But because this number is so large, Excel drops the last (least significant) digit, and puts a zero in its place.

If you type the number in the cell that is formatted as text, all the characters remain as you type them, because Excel does not attempt to store the credit card id as a number, but leaves it as text.  

Properties

Article ID: 269370 - Last Review: December 9, 2013 - Revision: 1.0
Applies to
  • Microsoft Excel 2013
  • Microsoft Excel 2010
  • Microsoft Office Excel 2007
  • Microsoft Office Excel 2003
  • Microsoft Excel 2002 Standard Edition
  • Microsoft Excel 2000 Standard Edition
  • Microsoft Excel 97 Standard Edition
  • Microsoft Excel 2004 for Mac
  • Microsoft Excel X for Mac
  • Microsoft Excel 2001 for Mac
  • Microsoft Excel 98 for Macintosh
Keywords: 
kbformat kbprb KB269370

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com