develooper Front page | | Postings from October 2004

RE: [OT] Excel Golf: Unix Time to Excel Time in one line

Thread Previous | Thread Next
Gerber, Christopher J
October 26, 2004 09:33
RE: [OT] Excel Golf: Unix Time to Excel Time in one line
Message ID:
> -----Original Message-----
> From: McGlinchy, Alistair 
> From: Stephen Turner:
> > On Tue, 26 Oct 2004, McGlinchy, Alistair wrote:
> > > Here's a horrid 297 Byte solution:
> > I don't know much about Excel, but I think DATE(1970,1,1) can be 
> > spelled 25569. If I'm right, that would save you at least
> > 63 strokes.
> > 
> I feel suitably humbled. Thanks to you and Joe for some significant
> improvements.
> =25569+A4/86400+1/24*AND(DATE(YEAR(25569+A4/86400),5,1)-WEEKDA
> R(25569+A4/86400),5,1),2)+1/24<25569+A4/86400,25569+A4/86400<D
> 5569+A4/86400),11,1)-WEEKDAY(DATE(YEAR(25569+A4/86400),11,1),2)+2/24)
> With only 214 characters, the formula is only two lines on my 
> screen so
> I can see my column headings (but not Excel's column head.

A couple more small changes:

 AND(X,Y) can be changed to (X)*(Y) in this case

 1/24*X can be changed to X/24

 2/24 can be changed to 1/12, although it's not shorter

 86400/24 can be changed to 3600



Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About