Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / June 2006

Tip: Looking for answers? Try searching our database.

Problems with date time format

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jay - 07 Jun 2006 17:49 GMT
I pull information from a computer program that my work uses, and I
have to analyze data based on date.
The program exports the date as 6/30/2005 09:46:16:296, which excel
does not recognize as a date/ time format.  I need a macro that
converts any date/ time like the above to:  6/30/2005 09:46:16
(dropping off everything after the seconds)
Is this possible?
Bernard Liengme - 07 Jun 2006 18:14 GMT
Just removing the time will not help. You are importing text; Excel stores
dates as serial numbers (starting with 1 Jan 1900) and DISPLAY this number
as a date. You will need to use text functions such as LEFT, MID and RIGHT
to extract month, day and year and use the YEAR function to make a valid
serial date.
Sitting in an airport right now so I have no time to experiment for you.
best wishes
Signature

Bernard Liengme
www.stfx.ca/people/bliengme
remove CAPS in email address

>I pull information from a computer program that my work uses, and I
> have to analyze data based on date.
[quoted text clipped - 3 lines]
> (dropping off everything after the seconds)
> Is this possible?
Ron Rosenfeld - 07 Jun 2006 18:47 GMT
>I pull information from a computer program that my work uses, and I
>have to analyze data based on date.
[quoted text clipped - 3 lines]
>(dropping off everything after the seconds)
>Is this possible?

If your Windows Regional Settings are MDY, then you can use the formula:

=--SUBSTITUTE(A1,":",".",3)

will convert the above to time INCLUDING the fractional seconds.

If you don't want the fractional seconds, then use:

=--LEFT(SUBSTITUTE(A1,":","~",3),FIND("~",SUBSTITUTE(A1,":","~",3))-1)

--ron
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.