Help and Support

Last digits are changed to zeroes when you type long numbers in cells of Excel

Article ID:269370
Last Review:January 27, 2007
Revision:7.1
This article was previously published under Q269370

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.

Back to the top

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.

Back to the top

WORKAROUND

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

Back to the top

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.

Back to the top


APPLIES TO
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

Back to the top

Keywords: 
kbformat kbprb KB269370

Back to the top

Article Translations

 

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.