Forum Statistics
- Forum Members:
- Total Threads:
- Total Posts: 7
There are 1 users currently browsing forums.
|
 |

01-09-2009, 06:52 PM
|
|
Valued Forum Contributor
|
|
Join Date: 09 Feb 2004
Posts: 98
|
|
|
convert a text date into a proper date
Please Register to Remove these Ads
I have a column of dates in thie format " January 5 03:09:36 2009" which i need to convert into a proper excel date that i can do further calculations on (adding up things, graphs etc based on dates).
Note the space before the month name. I thought about doing a left(cell,xx) to get it but that isnt going to work with the space infront and the variable length of month names.
I do not necessarily need the time included, it may be useful at some point if its easy to keep it as part of the data, if not i can live without it.
Thanks
Last edited by neowok; 01-09-2009 at 07:48 PM.
|

01-09-2009, 07:04 PM
|
 |
Forum Moderator
|
|
Join Date: 14 Jan 2006
Location: England
MS Office Version:2002 (work), 2003 & 2007 (home)
Posts: 6,560
|
|
|
Are you in the US? If your default date format is m/d/yy then, assuming your timestamp in A1 you can extract the date with this formula in B1
=MID(REPLACE(A1,LEN(A1)-13,9,","),2,99)+0
Format B1 as a date
If you want to include the time, too try
=MID(REPLACE(A1,LEN(A1)-13,0,", "&RIGHT(A1,4)),2,LEN(A1))+0
and format as date and time
|

01-09-2009, 07:11 PM
|
|
Valued Forum Contributor
|
|
Join Date: 09 Feb 2004
Posts: 98
|
|
|
Thanks
I am in UK so d/m/y
tried those anyway but got #value error, it didnt seem to like the +0 at the end, taking it off seems to show the date but leaves it as text still
Last edited by neowok; 01-09-2009 at 07:15 PM.
|

01-09-2009, 07:28 PM
|
 |
Forum Guru
|
|
Join Date: 23 Jun 2007
Location: London,England
MS Office Version:office 97 ,2003 ,2007
Posts: 6,006
|
|
|
try
=VALUE(A1)
edit oops to quick sorry
that returns 1 jan 05
|

01-09-2009, 07:30 PM
|
|
Valued Forum Contributor
|
|
Join Date: 09 Feb 2004
Posts: 98
|
|
|
nup dont work, comes up as 1st jan 2005
i think the solution above will work, i just need to figure out how to move the day to the left of the month in the formula to UK format and then i guess itll work
|

01-09-2009, 07:41 PM
|
 |
Forum Moderator
|
|
Join Date: 14 Jan 2006
Location: England
MS Office Version:2002 (work), 2003 & 2007 (home)
Posts: 6,560
|
|
|
For UK settings try like this for the date
=REPLACE(REPLACE(A1,FIND(":",A1)-2,9,MID(A1,2,FIND(" ",A1,2)-1)),1,FIND(" ",A1,2),"")+0
and for date and time
=REPLACE(REPLACE(A1,FIND(":",A1)-2,9,MID(A1,2,FIND(" ",A1,2)-1)),1,FIND(" ",A1,2),"")+LEFT(RIGHT(A1,13),8)
If you want date in one cell annd time in another then use the first one for the date and
=LEFT(RIGHT(A1,13),8)+0
for the time
|

01-09-2009, 07:45 PM
|
|
Valued Forum Contributor
|
|
Join Date: 09 Feb 2004
Posts: 98
|
|
|
thanks that worked
|
 |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|