Formating Large number as date
On Thu, 30 Oct 2008 06:48:01 -0700, BDT wrote:
I have columns of numbers that represent date/time info. For instance I have
the number 20081029092245 which represents:
2008/10/29 09:22:45 or October 29, 2008 at 9:22 AM
And I want it to display as one of the above formats.
I can parse the big number and concatenate the resulting columns, but is
there a less cumbersome way to do this with Format/Cells/Number/Custom or
something similar?
Many thanks.
No there is not. Formatting only affects how the data is displayed, not how it
is parsed on data entry.
With your big number in A1, you could use this formula to convert it to a value
Excel understands; and then format it however you like:
=DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))+TIME(MID (A1,9,2),MID(A1,11,2),RIGHT(A1,2))
OR, if this will be used on systems utilizing the US Date format, you could
convert it to a proper Excel date/time value with this formula:
=--TEXT(A1,"0000\-00\-00\ 00\:00\:00")
--ron
|