LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Convert int ccyymmdd to date(time)

On Thu, 24 Jul 2008 07:33:38 -0700 (PDT), "
wrote:

On Jul 23, 7:47*pm, Ron Rosenfeld wrote:
On Wed, 23 Jul 2008 15:31:16 -0700 (PDT), "
wrote:

Hi, our legacy system keeps dates in integers in form ccyymmdd.


I've long known how to convert, inExcel, a datetime to a number. *One
example is:


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


But looks as I may, I haven't found a way to convert a ccyymmdd int
into a datetime.


Oh also, I'm using Office 2007. *The FORMAT function, which might (?)
have helped me, seems to have disappeared.


thanx - pat


Perhaps I should also ask you what is a "ccyymmdd int" ? *Maybe I'm not
understanding the significance of the " int".

To convert anExceldate time into the ccyymmdd format, you can use the TEXT
function:

=TEXT(A1,"yyyymmdd")

To make that an Integer, you could precede the formula with a double unary.

=--TEXT(A1,"yyyymmdd")

Like others, I am confused as to what you want.
--ron


Geez now that I look again at my first two posts, I got it backwards.
No wonder (and apologies) for the confusion.

What I want is to convert a DATETIME to a NUMBER. (and the formula I
gave was saying: I know how to do it the reverse way, NUMBER to
DATETIME, but now I want DATETIME to NUMBER).

And you just gave me that Ron (just tested it).

=--TEXT(A1,"yyyymmdd").

The 'int' part is programmer-talk for integer. Or in excel NUMBER.
That is, I have a DATETIME and I want to convert it to an NUMBER. Of
format ccyymmdd ( or if you prefer, yyyymmdd ).

Anyway, thanx Ron.

Oh and the double unary operator - have never seen it before. Very
cool.

pat


Well, I'm glad my guess turned out to be helpful. Thanks for the feedback.
--ron


 
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
Convert date/time to time only in Excel? Gretchen Excel Discussion (Misc queries) 4 August 7th 07 01:54 PM
Can Excel (2003) reverse date from ccyymmdd to mmddccyy? Don Excel Discussion (Misc queries) 6 July 25th 07 01:17 AM
convert second to date and time --== Alain ==-- Excel Worksheet Functions 4 December 8th 06 10:19 AM
How do I convert a date&time (yyyy-mm-dd hh:mm:ss) to date only? Wesley Accellent Excel Worksheet Functions 6 December 1st 05 07:03 PM
Convert date to length of time in months from set date MJUK Excel Worksheet Functions 1 March 19th 05 06:31 PM


All times are GMT +1. The time now is 06:09 AM.

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

About Us

"It's about Microsoft Excel"