1

I have a csv file that contains cells such as "+1.8882789780". When viewed in Excel, it loses the last digit possibly due to excel truncation.

Is there a way to either change the setting in Excel to prevent this from happening or change the csv file in some way?

One way is to wrap single quotes around the cell contents in addition to the double quotes.

"'+1.8882789780'"

Is there a better way?

Excellll
  • 12,627
  • 11
  • 51
  • 78
user15586
  • 657
  • 3
  • 10
  • 20

1 Answers1

1

Precede the quoted string with an = sign, e.g., ="+1.8882789780".

Nicole Hamilton
  • 9,935
  • 1
  • 21
  • 43
  • Note that if you're using Excel 2007, it has a bug that might require a workaround (depending on the quoted text). Read [this thread](http://stackoverflow.com/questions/165042/stop-excel-from-automatically-converting-certain-text-values-to-dates) for details. – Karan Sep 22 '12 at 22:53
  • is there a way without changing the actual content? like modifying excel settings? – user15586 Sep 22 '12 at 23:30
  • 3
    Yes. You can also select the cells of interest, right-click and select `Format Cells ...`, then select `Text`. But you'll need to do that before entering the value. Once it's been interpreted as a numeric value, the extra digits will have been lost. – Nicole Hamilton Sep 22 '12 at 23:38
  • 1
    Addition to the comment just above: remember that Excel can't save formatting information in csv file – Serge Sep 23 '12 at 01:39
  • 1
    @Serge, true, but cells formatted as Text will be saved exactly as entered and displayed. – Excellll Sep 24 '12 at 00:16