Excel Leap Year and Julian Date formulas :: MrExcel Message Board


 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

Leap Year and Julian Date formulas
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

TiggerToo
Board Regular


Joined: 27 Feb 2002
Posts: 77
Location: Macon, Georgia USA
Flag: Blank

Status: Offline

 Reply with quote  

I need and updated type formula for for Julian Dates, where I can type in a julian date and get the date plus the day of the week, or vice verse.
Like 2060 would be Mar 1, 2002

I also need an updated formula for Leap Years such as iif I put in a date at anytime of a year JUN 10, 1999 instead of telling me, No - Not a leap Year I would like for cell to tell me when is the next leap year.

JUN 1999 the next cell would should 2000
MAR 2002 would show 2004.



[ This Message was edited by: TiggerToo on 2002-03-13 13:54 ]

Post Wed Mar 13, 2002 6:51 pm 
 View user's profile Send private message Send e-mail

Mark W.
MrExcel MVP


Joined: 11 Feb 2002
Posts: 7146
Location: Austin, Texas USA
Flag: Usa

Status: Offline

 Reply with quote  

What do you use for the Julian date for Mar 1, 2010? For Mar 1, 2110?

Without an answer to the above questions here's a stab at your 1st request...

=DATE(LEFT(A1,LEN(A1)-3),1,0)+RIGHT(A1,3)

...for a julian date value in cell A1. The cell containing the formula can be formatted as...

ddd, m/d/yyyy

[ This Message was edited by: Mark W. on 2002-03-13 16:27 ]

Post Wed Mar 13, 2002 7:09 pm 
 View user's profile Send private message

Mark W.
MrExcel MVP


Joined: 11 Feb 2002
Posts: 7146
Location: Austin, Texas USA
Flag: Usa

Status: Offline

 Reply with quote  

Here's a "brute force" array formula that satisfies your leap year request...

{=MAX(IF(DAY(DATE(YEAR(A1)+{1,2,3,4},3,0))=29,YEAR(A1)+{1,2,3,4}))}

...for a date value in cell A1. There's probably a more elegant approach, but I'll have to think on it awhile.

Note: Array formulas must be entered using the Control+Shift+Enter key combination. The outermost braces, { }, are not entered by you -- they're supplied by Excel in recognition of a properly entered array formula.

BTW, I've re-read your original request and still can decide if you always want to display the next leap year even if the date in cell A1 (3/2/2000) falls within a leap year. If you want 3/2/2000 to display 2000 instead of 2004 use this array formula instead...

{=MAX(IF(DAY(DATE(YEAR(A1)+{0,1,2,3},3,0))=29,YEAR(A1)+{0,1,2,3}))}

[ This Message was edited by: Mark W. on 2002-03-13 15:17 ]

Post Wed Mar 13, 2002 7:20 pm 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.