Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default How to decode integer timestamps?

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!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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))
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default How to decode integer timestamps?

No, all that does is display the date by hacking it into pieces and sticking
them together again.

How would that method be able to supply the data for a correctly-scaled date
axis on a (x,y) graph?


"Glenn" wrote:

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))

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default How to decode integer timestamps?

I am trying to figure out exactly what you are trying to accomplish. You have
data of 20081119 in a cell, you need the date formatted as 2008/11/19 in
another cell. Why is it that Glenn's formula doesn't work?
--
** John C **

"Ron West" wrote:

No, all that does is display the date by hacking it into pieces and sticking
them together again.

How would that method be able to supply the data for a correctly-scaled date
axis on a (x,y) graph?


"Glenn" wrote:

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))

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default How to decode integer timestamps?

OK - I was wrong - it does work - but I have to apply a Custom cell format
€œYYYY/MM/DD€ to display it correctly

"John C" wrote:

I am trying to figure out exactly what you are trying to accomplish. You have
data of 20081119 in a cell, you need the date formatted as 2008/11/19 in
another cell. Why is it that Glenn's formula doesn't work?
--
** John C **

"Ron West" wrote:

No, all that does is display the date by hacking it into pieces and sticking
them together again.

How would that method be able to supply the data for a correctly-scaled date
axis on a (x,y) graph?


"Glenn" wrote:

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))



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default How to decode integer timestamps?

The formula turns a number, formatted to your specification, into an Excel date.
It should work just fine for a graph.


Did you try it?



Ron West wrote:
No, all that does is display the date by hacking it into pieces and sticking
them together again.

How would that method be able to supply the data for a correctly-scaled date
axis on a (x,y) graph?


"Glenn" wrote:


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


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!

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default How to decode integer timestamps?

If you want, you could do the one of the following as well:
=TEXT(DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)),"yy yy/mm/dd")
or
=REPLACE(REPLACE(A1,7,0,"/"),5,0,"/")
Don't forget to mark question as answered by clicking the YES box below (be
sure to give credit to Glenn for his original response).

Glad it's working :)
--
** John C **

"Ron West" wrote:

OK - I was wrong - it does work - but I have to apply a Custom cell format
€œYYYY/MM/DD€ to display it correctly

"John C" wrote:

I am trying to figure out exactly what you are trying to accomplish. You have
data of 20081119 in a cell, you need the date formatted as 2008/11/19 in
another cell. Why is it that Glenn's formula doesn't work?
--
** John C **

"Ron West" wrote:

No, all that does is display the date by hacking it into pieces and sticking
them together again.

How would that method be able to supply the data for a correctly-scaled date
axis on a (x,y) graph?


"Glenn" wrote:

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))

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default How to decode integer timestamps?

Assuming 20081119 = yyyymmdd

Try it like this:

=--TEXT(A1,"0000\/00\/00")

Format as yyyy/mm/dd

--
Biff
Microsoft Excel MVP


"John C" <johnc@stateofdenial wrote in message
...
If you want, you could do the one of the following as well:
=TEXT(DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)),"yy yy/mm/dd")
or
=REPLACE(REPLACE(A1,7,0,"/"),5,0,"/")
Don't forget to mark question as answered by clicking the YES box below
(be
sure to give credit to Glenn for his original response).

Glad it's working :)
--
** John C **

"Ron West" wrote:

OK - I was wrong - it does work - but I have to apply a Custom cell
format
"YYYY/MM/DD" to display it correctly

"John C" wrote:

I am trying to figure out exactly what you are trying to accomplish.
You have
data of 20081119 in a cell, you need the date formatted as 2008/11/19
in
another cell. Why is it that Glenn's formula doesn't work?
--
** John C **

"Ron West" wrote:

No, all that does is display the date by hacking it into pieces and
sticking
them together again.

How would that method be able to supply the data for a
correctly-scaled date
axis on a (x,y) graph?


"Glenn" wrote:

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))



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default How to decode integer timestamps?

.... or you might get away with =--TEXT(A2,"0000\-00\-00") and formatting as
date.
--
David Biddulph

"Glenn" wrote in message
...
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))



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
decode renuka Excel Discussion (Misc queries) 3 November 1st 07 08:50 AM
charts with Timestamps - only date part taken into account F Trouwaen Charts and Charting in Excel 1 September 5th 06 03:07 AM
how to find time difference between timestamps to a millisecond? sp New Users to Excel 2 June 16th 06 06:10 PM
serial number decode chiuinggum Excel Worksheet Functions 6 June 13th 06 09:15 AM
timestamps in excel Chuck Cusack Excel Discussion (Misc queries) 4 January 24th 06 06:12 AM


All times are GMT +1. The time now is 04:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright İ2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"