Vacation Pay Calculation
I'm still a little confused over what exactly you're trying to
calculate. How about something like this that calculates total
eligible vacation days given a starting date (hire date) and ending
date (current date, vacation date, etc.)? Note that this calc assume
vacation days are accrued every x days, where x = 365/# of eligible
vacation days per year, i.e. 365/21 = ~26; and there is also some
imprecision based on years with fewer than 365 days, i.e. leap years.
hire.date = 1/1/2000
=int(if((end.date-hire.date)/365<5, (end.date-hire.date)/365*14,
5*14+(((end.date-hire.date)/365)-5)*21))
end.date = 1/1/2004 = 56
end.date = 1/1/2005 = 70
end.date = 1/1/2006 = 91
end.date = 7/1/2006 = 101
If an employee is eligible for all their annual vacation days on their
hiring anniversary, you can change the equation as follows:
=if((end.date-hire.date)/365<5, int((end.date-hire.date)/365)*14,
5*14+int((((end.date-hire.date)/365)-5))*21)
Does this help?
|