View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Glenn Glenn is offline
external usenet poster
 
Posts: 1,240
Default How to decode integer timestamps?

Ron West wrote:
I've been asked to find a simple way of decoding a numeric (integer)
timestamp (representing date only) into native Excel date format, so that it
can be displayed in the "YYYY/MM/DD" format AND also be used as data for one
of the axes of a graph on the same sheet.

For example, I need to take a column of numeric timestamps in the form
20081119 (integer datatype) and convert them to Excel date-numbers like 39772
so that when I display the resulting column using the "YYYY/MM/DD" format it
comes back out like "2008/11/19", etc.

Obviously, I can do it using a lot of fiddly coding to extract the date
parts, but I can't be the first person to want to do this! Are there any
native TimeStamp processing functions in Excel that I've missed?

Thanks!



=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))