View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
notMe notMe is offline
external usenet poster
 
Posts: 4
Default different values depending on how text file is opened

Hi Nika,
Thanks for suggesting the settings for Windows but the Regional and language
options are already set to French(France) and date format = dd/mm/yyyy.
I have no idea how to fix this behaviour in Excel...

Another idea maybe ?

Hi,

Excel by default uses format as selected in Windows - Control Panel -
Regional and language options.
I can namely see from your example that when excel displays date correct
it
does not display it as date (if the date is aligned left), but as text.
Try to change this date options to dd/mm/yyyy and then open this txt file.
If dates are displayed correctly, save the file as excel (dates will be
saved
as dates) and then change date format in control panel.
If you change it for example to dd.mm.yyyy, excel should display dates as
dd.mm.yyyy.

Regards,
Nika Lampe

"notMe" je napisal:

Sorry for the lengthy post...

1- explanation

With File Explorer double-clicking on a tab-delimited text file is not
the
same as drag'n'dropping that file into an occurrence of Excel.
All dates are changed to another format with double-clicking, they are
kept
'as is' with drag'n'drop.

With double-clicking :
Dates are standard ISO (dd/mm/yyyy ) but Excel *transforms* the actual
data
into mm/dd/yyyy.
The swapping of dd and mm only occurs when dd < 13. Otherwise the field
is
kept left-aligned like a text filed.

day(<myCell) gives different results depending on how the file was
opened
so it is not a mere formatting problem.
The data is altered by Excel and it does not seem right. At least it
should
always be done consistently.

2- example :

Text file : foo.gs
A <tab 16/09/2006
B <tab 08/09/2006

Displayed in Excel after double-clicking :
A.........B..........DAY(B)
A 16/09/2006 16
B 09/08/2006 09 <= wrong value : why swap dd and mm at all ?

Displayed in Excel after dragging :
A.........B..........DAY(B)
A 16/09/2006 16
B 08/09/2006 8


Any way to fix this ?

This is on a French Windows XP system, set to French(France) and the
formatting for date is dd/mm/yyyy.
I can't change this because other apps need this setting. Not sure Excel
uses it either!

Files have a .gs extension and are associated with Excel in File Explorer
options menu.