Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Excel converts string in CSV file as number

A file named test.csv has one line in it:

16E035

This is an accounting code used at our university. If I open that file,
Excel shows 1.6*10^36 in cell A1. If I specify that the value is a string:

"16E035"

Excel still converts it to 1.6*10^36. How should this value be entered in
the file so Excel leaves it as a character string?

Thanks for your help.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,316
Default Excel converts string in CSV file as number

From Excel, click FILE, OPEN change the FILES OF TYPE to text and select the
file. This opens the import wizard where you specify what the delimiter is
and what data type to assign to each field. For an accounting code such as
yours Excel will set the column to a GENERAL data type which will treat the
value as a number. Change the data type to text and your data will import as
a lable and not as a value.
--
Kevin Backmann


"DavidC" wrote:

A file named test.csv has one line in it:

16E035

This is an accounting code used at our university. If I open that file,
Excel shows 1.6*10^36 in cell A1. If I specify that the value is a string:

"16E035"

Excel still converts it to 1.6*10^36. How should this value be entered in
the file so Excel leaves it as a character string?

Thanks for your help.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Excel converts string in CSV file as number

If you include another character, like:

'16E035, or _16E035

it will be treated as text. The first one has the advantage that it
will not be displayed.

Alternatively, rename the file as a .txt file, then do File | Open in
Excel and you will be taken into the Data Import Wizard, in the third
panel of which you can specify that you want the data to be imported
as text.

Hope this helps.

Pete

On Jul 25, 2:16*pm, DavidC wrote:
A file named test.csv has one line in it:

* 16E035

This is an accounting code used at our university. If I open that file,
Excel shows 1.6*10^36 in cell A1. If I specify that the value is a string:

* "16E035"

Excel still converts it to 1.6*10^36. How should this value be entered in
the file so Excel leaves it as a character string?

Thanks for your help.


  #4   Report Post  
Posted to microsoft.public.excel.misc
dlw dlw is offline
external usenet poster
 
Posts: 510
Default Excel converts string in CSV file as number

when I tried it with "16E035" in the csv file, and when opening it in excel
chose " as the text qualifier and text as the field type, it worked.
Then I tried it with just 16E035 in the csv file, and chose text as the
field type, and that worked too.

Not sure what you are doing wrong?

"DavidC" wrote:

A file named test.csv has one line in it:

16E035

This is an accounting code used at our university. If I open that file,
Excel shows 1.6*10^36 in cell A1. If I specify that the value is a string:

"16E035"

Excel still converts it to 1.6*10^36. How should this value be entered in
the file so Excel leaves it as a character string?

Thanks for your help.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 208
Default Excel converts string in CSV file as number

Instead of opening the CSV file, open a blank spreadsheet.

Go to Data - Import

Select the CSV file, hit next a few times...on the 3rd step, select
the column that has the accounting code in it and format it as text.



On Jul 25, 9:16*am, DavidC wrote:
A file named test.csv has one line in it:

* 16E035

This is an accounting code used at our university. If I open that file,
Excel shows 1.6*10^36 in cell A1. If I specify that the value is a string:

* "16E035"

Excel still converts it to 1.6*10^36. How should this value be entered in
the file so Excel leaves it as a character string?

Thanks for your help.




  #6   Report Post  
Posted to microsoft.public.excel.misc
dlw dlw is offline
external usenet poster
 
Posts: 510
Default Excel converts string in CSV file as number

ay, there's the rub, my test file was .txt so it went into the import
routine...

"dlw" wrote:

when I tried it with "16E035" in the csv file, and when opening it in excel
chose " as the text qualifier and text as the field type, it worked.
Then I tried it with just 16E035 in the csv file, and chose text as the
field type, and that worked too.

Not sure what you are doing wrong?

"DavidC" wrote:

A file named test.csv has one line in it:

16E035

This is an accounting code used at our university. If I open that file,
Excel shows 1.6*10^36 in cell A1. If I specify that the value is a string:

"16E035"

Excel still converts it to 1.6*10^36. How should this value be entered in
the file so Excel leaves it as a character string?

Thanks for your help.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I enter a date in Excel it converts to a 5-digit number. WHY? Wendy@EIS Excel Discussion (Misc queries) 1 January 8th 07 09:32 PM
Excel converts 9-digit string to sci. not. when saved as csv epen Excel Discussion (Misc queries) 1 September 20th 06 10:15 PM
Excel file from IE auto converts to PDF Cary K Excel Discussion (Misc queries) 1 August 15th 06 05:43 PM
Excel converts formula to number noyb New Users to Excel 9 June 22nd 06 04:41 PM
Using Excel converts number to english text Lionel Lim (Malaysia) Excel Worksheet Functions 1 April 22nd 05 10:16 PM


All times are GMT +1. The time now is 06:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"