Help - Search - Members - Calendar
Full Version: Excel date problem any ideas - custom format doesn't work
Gladiator Security Forum > Computer Software & Hardware > General Software > Discussion about General Software Programs
stidyup
DOB
19260721
19350206
19311203
19251223
19350626
19261003
19240405
19311127
19271118
19340318


I have a column full of dates like this, I need to convert them into a proper date. However excel doesn't like the number, trying a custom date of yyyy/mm/dd you just get a huge line of ################# appearing.

Been searching google but so far not found anything, is there anyway of doing this?
stidyup
http://en.allexperts.com/q/Excel-1059/excel-formatting.htm

QUOTE
Question
Hello RICHARD,

I'm running Office 2003. In Excel, if someone sends me dates that are formatted in this manner: 20041225 (year, month, date) is there a way to convert this to look like 12/25/2004. I need to do this on a large scale. I would hate to have to do this one cell at a time.

Any help would be grateful!

Answer
Jerry

Since the formatting that you have, 20041225, isn't an accepted date format in excel 2003, we won't simply be able to reformat the cells to the 12/25/04 date format. However we can use a methods to change the numbers so that they are in an acceptable date format.

First--you can use text to columns to separate the number into 4 columns, with 20 in the first column, 04 in the second column, 12 in the third column, and 25 in the fourth column.

Second you can then use a concatenate type formula to reassemble the number the way you want it to look. for example.

=+C1&F1&D1&F1&G1&B1

Here is what we did
Used text to columns on the number as input into cell A1 to separate the number into 4 columns they were 20,4,12,25
in columns A,B,C,D respectfully. Go to toolbar/text to columns/pick fixed width in the next window and click where you want the number separated then clic next, then clic finish. This will separate the number, and you can do a wholde column of numbers at once.

Then use the formula
=+C1&F1&D1&F1&G1&B1

to put them back together in the order you want. Note that in cell F1 I placed the backslash '/ and in cell G1 I placed a zero. The zero will have to be added back in front of the 4, because it is lost when converted to columns.


Got lucky with google :)
stidyup
=DATE(LEFT(A1,4), MID(A1,5,2),RIGHT(A1,2))

This was sent to me by a colleague and also works.
Nebon
Great that you managed to find a solution and thanks for sharing it with us Stidyup.
stidyup
http://www.mrexcel.com/leobook.html

QUOTE
As mentioned, you can get a low-resolution e-book version of my new book, Learn Excel 97-2007 from MrExcel. This is the complete book. It is in low resolution, so it will appear fine on your computer monitor. It is not suitable for printing.


Free excel book.

Posting questions on forum's seems to be a lucky charm as I usually end up finding the answer before someone replies with a answer.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.