Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
birkato
 
Posts: n/a
Default space before date in csv files


I often have to import CSV files into excel and the files contain dates
such as

1/2/05 12:22:12 PM

The problem is that when I import them, there is a space before the
date so it is not taking as a date unless I remove the space. I tried
to use the "TRIM" command and it does take the space off, but it still
won't recognize those values as dates for some reason. If I use the
trim function and then copy the values only into another cell it still
won't act as a date until I go in to edit the cell and then click out
of it.

Has anyone ever run into this and do you have any suggestions?


--
birkato
------------------------------------------------------------------------
birkato's Profile: http://www.excelforum.com/member.php...o&userid=21011
View this thread: http://www.excelforum.com/showthread...hreadid=388751

  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

birkato,

=TRIM(A1)*1

will force the string that TRIM returns into a date (a number, actually). Simply format the cell
with the formula as a date.

HTH,
Bernie
MS Excel MVP


"birkato" wrote in message
...

I often have to import CSV files into excel and the files contain dates
such as

1/2/05 12:22:12 PM

The problem is that when I import them, there is a space before the
date so it is not taking as a date unless I remove the space. I tried
to use the "TRIM" command and it does take the space off, but it still
won't recognize those values as dates for some reason. If I use the
trim function and then copy the values only into another cell it still
won't act as a date until I go in to edit the cell and then click out
of it.

Has anyone ever run into this and do you have any suggestions?


--
birkato
------------------------------------------------------------------------
birkato's Profile: http://www.excelforum.com/member.php...o&userid=21011
View this thread: http://www.excelforum.com/showthread...hreadid=388751



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
How do I create a schedule from a list of dates ? Gavin Morris Charts and Charting in Excel 2 October 28th 10 04:08 PM
merging my excel files Donna YaWanna Excel Discussion (Misc queries) 1 June 14th 05 12:53 AM
Recurring annual events using a specific date as a trigger date Bamboozled Excel Worksheet Functions 1 June 6th 05 01:44 PM
Converting numbers to date format from csv files FiBee Excel Discussion (Misc queries) 1 January 12th 05 01:30 PM
Using formulas to determine date in one cell based on date in anot Gary Excel Worksheet Functions 2 November 22nd 04 08:11 AM


All times are GMT +1. The time now is 07:44 AM.

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"