Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Why does Excel mis-convert a string to a date

In a CSV file I have <<,"6 - 14",. On opening the file Excel 2007
strangely converts this to 14 Jun as a number. Clearly the CSV file said
this was a string. Why does Excel think it knows better and give a poor user
outcome.

Regards

Nick
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Why does Excel mis-convert a string to a date

Can you rename the *.csv to *.txt before opening?

The text wizard will then pop up allowing you to choose in third step what
format each column is to be.

Select Text for that column.


Gord Dibben MS Excel MVP

On Sun, 16 Aug 2009 18:25:01 -0700, Nickred001
wrote:

In a CSV file I have <<,"6 - 14",. On opening the file Excel 2007
strangely converts this to 14 Jun as a number. Clearly the CSV file said
this was a string. Why does Excel think it knows better and give a poor user
outcome.

Regards

Nick


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Why does Excel mis-convert a string to a date

Gord

Unfortunately my data is not a simple database format. It has some header
rows at the to an when I try your trick id does not work. Excel still
persist as reading 6 - 14 as 14 June.

Regards

Nick


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Why does Excel mis-convert a string to a date

How did it not work?

If you rename the file to *.txt, then when you use File|Open, you should see a
wizard that allows you to specify that it's delimited (by commas) and in another
step, you can specify that any (or all????) field can be treated as text.

If you have data in that same field that should be treated as dates, you could
import them all as text and then convert the real dates to dates--using whatever
rules that you need.



Nickred001 wrote:

Gord

Unfortunately my data is not a simple database format. It has some header
rows at the to an when I try your trick id does not work. Excel still
persist as reading 6 - 14 as 14 June.

Regards

Nick


--

Dave Peterson
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
Convert a string to a date? Terry Pinnell Excel Discussion (Misc queries) 3 September 24th 07 12:07 PM
How to convert string to date phil Excel Worksheet Functions 2 October 2nd 06 06:01 PM
convert string to date Sean Excel Worksheet Functions 5 March 1st 06 09:54 PM
Convert Date to STring tonymaguire Excel Discussion (Misc queries) 9 February 15th 06 11:33 AM
How to convert string to a date galsaba Excel Worksheet Functions 3 March 4th 05 05:20 PM


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

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

About Us

"It's about Microsoft Excel"