Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Large number in Excel - changed last digit to 0

Status
Not open for further replies.

MemphisVBA

Technical User
May 31, 2006
23
US
I am trying to enter a credit card number into Excel - they are generally 15 or 16 digits. When I put a large number like that into Excel, the last digit is changed to zero.

If I enter it as text (by placing a ' in front) that works, but the file is uploaded into another system that is looking for that column to be a number - not text.

Any ideas?
 
Have you checked the cell format? (Right click on the column to select all the cells in that column, choose FORMAT CELLS)

-- Jason
"It's Just Ones and Zeros
 
Excel has only 15 digit precision for double precision floating point numbers. This means it will always lose the last digit of a sixteen digit credit card number.

The workarounds are either to format the cell as text before entering your data--or by prefixing the number with a single quote (to denote text).

I assume that you are exporting your data as a text or csv file (every other Windows program is going to have the same problem with 15 digit precision). If so, check the values that you are exporting using Notepad. Reopening the file in Excel will give misleading results because in its zeal to be helpful Excel will convert everything to a number (possibly even in scientific notation), with resulting loss of precision.

Brad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top