Printable Version | Subscribe | Add to Favourites
New Topic New Poll New Reply
Author: Subject: can't convert data in text format to date (in Excel)
mads

posted on 19/7/11 at 11:33 AM Reply With Quote
can't convert data in text format to date (in Excel)

Hey up all,
Having some difficulty with a spreadsheet one of my colleagues has been working on. The values in one of the columns is in a text format e.g. 19072011 but when I try to convert it to date formate, I just get a load of # symbols. Anyone know how I can easily convert this? I have tried the datevalue function but to no avail.

The file is available here


Any help would be appreciated, as always


Cheers,

mads





We gain knowledge faster than we do wisdom!

Life is not a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in sideways, thoroughly used, totally worn out and loudly proclaiming... "f*ck, what a trip!"

View User's Profile Visit User's Homepage View All Posts By User U2U Member
need4speed

posted on 19/7/11 at 11:41 AM Reply With Quote
Have you tried making the column wider?

Dave

View User's Profile E-Mail User View All Posts By User U2U Member
MikeRJ

posted on 19/7/11 at 12:01 PM Reply With Quote
I think the problem is that "23062004" is not a recognised date format, it's just a number to Excel as there are no field delimiters.

Try this:

=DATEVALUE(MID(K2,1,2) & "-" & MID(K2,3,2) & "-" & MID(K2,5,4))

Where cell K2 holds your date string

View User's Profile View All Posts By User U2U Member
edsco

posted on 19/7/11 at 12:02 PM Reply With Quote
Hi

Done it for you. U2U me your email and i'll send it over. Cant work out how to attach files on here....

Ta





edsco

View User's Profile View All Posts By User U2U Member
edsco

posted on 19/7/11 at 12:05 PM Reply With Quote
Or use MikeRJ suggestion as that works well as well. Simples!





edsco

View User's Profile View All Posts By User U2U Member
Scott W

posted on 19/7/11 at 12:11 PM Reply With Quote
Or you could have done:- Data>Text to columns>Next>Next>Column Data Format>Date>YMD and Finish
View User's Profile View All Posts By User U2U Member
mads

posted on 19/7/11 at 12:48 PM Reply With Quote
Thanks all.

Dave - I tried the column width but its to do with the formatting

MikeRJ - your solution worked a treat, thank you.

edsco - would still be interested how you did it for educational purposes. You have U2U.

Scott - it worked for most of the values but not all.





We gain knowledge faster than we do wisdom!

Life is not a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in sideways, thoroughly used, totally worn out and loudly proclaiming... "f*ck, what a trip!"

View User's Profile Visit User's Homepage View All Posts By User U2U Member
TimEllershaw

posted on 19/7/11 at 01:56 PM Reply With Quote
just be careful if you have any single digit days in there.

eg: 1st December as 1122003 rather than 01122003
- Excel has a habit of dropping leading zeros if it thinks they are simple numbers.

same for months. make sure you have 31st Jan as 31012003 and not 3112003


Cheers,
Tim.






http://www.teenagecancertrust.org/

View User's Profile E-Mail User Visit User's Homepage View All Posts By User U2U Member

New Topic New Poll New Reply


go to top






Website design and SEO by Studio Montage

All content © 2001-16 LocostBuilders. Reproduction prohibited
Opinions expressed in public posts are those of the author and do not necessarily represent
the views of other users or any member of the LocostBuilders team.
Running XMB 1.8 Partagium [© 2002 XMB Group] on Apache under CentOS Linux
Founded, built and operated by ChrisW.