View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Al Klein Al Klein is offline
external usenet poster
 
Posts: 1
Default How format number as text

Woody wrote:
Sorry to trouble you again. I only gave you part of the problem because I
was trying to keep it simple. However, the data for the file I am talking
about comes in from a .CSV file.

The field I am talking about has very long numbers, 14 characters.


Excel can only hold an 11 (decimal) digit mantissa. If the number has
more digits, Excel stores it as an 11 digit mantissa and an exponent, so
the digits aren't there for you to convert to text. (Formatting only
changes how the display looks, conversion [like =TEXT()] changes the
actual data.)

It is strange to me that I am having this problem in the first place because
the number are surrounded by double quotation marks in the csv file. That is,
I can open the csv file in Notepad and see that these numbers are surrounded
with quotes. Why Excel insists on bringing them in as numbers I don't know.


Excel is too smart. It evaluates what's between the quotes and, if it
looks like a number, the column becomes numeric (in storage, regaredless
of how you format it). You could try to add about 10 rows at the top of
the .csv file (just copy the first row, paste it, change the first item
to "dummy", and change "row XXX" to real text). That might force Excel
to set row XXX as a text column. (It works in Access, but Excel may
just make it a General column, which gives you the same problem.)