4

I have a column that has values stored as text:

'1002079943728939269'

I want to store it as int64 format, so that last digits are not lost. If I remove the quotes, the value displays as 1.00208E+18. The digits after 100207994372893 become 0.

How can I have a numeric format with support for long integer values?

5
  • 4
    Excel only supports up to about 15 digits, because of its internally used floating point representation. Can you explain what to do with this number?
    – trincot
    Commented Jul 22, 2016 at 9:11
  • I need to submit this to a competition, where it is stored as int64 format. I was able to get a workaround this, by first storing it as text then in a notepad and then importing the column as text data inside excel. Direct exporting to excel does not work
    – muni
    Commented Jul 22, 2016 at 9:36
  • But what is the competition about? I mean, do you need to perform calculations with those big numbers? What is your input and what is the desired output? Do you need to submit an Excel sheet, or is this challenge not related to Excel, and do you only use it as a tool?
    – trincot
    Commented Jul 22, 2016 at 9:38
  • I need to submit that excel sheet as csv, where this number is an ID
    – muni
    Commented Jul 22, 2016 at 9:44
  • 1
    So then why not use strings? As you don't need to do any calculation with it? Then save it as CSV, open the CSV file in notepad, and check there are no double quotes that are around those id values (In my test the numbers appeared without quotes). Would that do the trick for you?
    – trincot
    Commented Jul 22, 2016 at 9:57

1 Answer 1

3

Excel uses a 64-bit floating point representation for numbers entered in cells, which means you can only have 15 digits precision.

In comments you explained you actually need to produce a CSV file with these large numbers, which represent ID values.

Then the solution is to enter the numbers as text. There are two ways to do this:

  • Prefix the value with a single quote, but don't end them with single quote: once you have entered the value like that, the quote is not displayed in the cell, or

  • First format the cell as Text instead of General (via the ribbon) and then enter the number: the number will not automatically be converted to the number data type any more, but stay like text.

When you then save the document as CSV, open the CSV file in a text editor. You will see that the numbers appear as they should be: without the single quote, but also not wrapped in double quotes.

1
  • This is still a valid solution.
    – ZdWhite
    Commented Aug 7 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.