Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Leap Year
I have a formula that calculates an employee's anniversary
date. It looks like this: =IF(TODAY()=M34,364,0) Another formula takes the result of this cell and adds it to the employee's current anniversary date. However, I have not taken into account for a leap year??? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Leap Year
Not clear why you are using 364 not 365, but assuming you want 365 for leap
years, try =IF(TODAY()=M34,IF(MONTH(DATE(YEAR(TODAY()),2,29) )=2,365,364),0) -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "scrabtree23" wrote in message ... I have a formula that calculates an employee's anniversary date. It looks like this: =IF(TODAY()=M34,364,0) Another formula takes the result of this cell and adds it to the employee's current anniversary date. However, I have not taken into account for a leap year??? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Leap Year
=int((DATEDIF(A1,NOW(),"d"))/365.25)
This is currently used for a persons age. Their birth day goes in A1,the (DATEDIF(A1,NOW(),"d") function finds out how many days old they are. The rest assumes that if there is one leap day every four years then that's 0.25 per year, hence "/365.25". this works well enogh for our needs as the int function sorts most problems out, hth greg |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Leap Year
Hi
Here's a "next birthday" formula with birth date in cell A1. Pretty long, remove all line breaks that the posting may create: =DATE(YEAR(TODAY())+((MONTH(A1)<MONTH(TODAY()))+(M ONTH(A1)=MONTH(TODAY()))*( DAY(A1)<DAY(TODAY()))),MONTH(A1),DAY(A1)) -- HTH. Best wishes Harald Followup to newsgroup only please "scrabtree23" skrev i melding ... I have a formula that calculates an employee's anniversary date. It looks like this: =IF(TODAY()=M34,364,0) Another formula takes the result of this cell and adds it to the employee's current anniversary date. However, I have not taken into account for a leap year??? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Leap Year | Excel Worksheet Functions | |||
Leap Year | Excel Discussion (Misc queries) | |||
leap year | Excel Discussion (Misc queries) | |||
Leap Year | Charts and Charting in Excel | |||
How to determine if year is a leap year | Excel Worksheet Functions |