I like to think I'm okay at the simpler tasks of exploiting Excel, but I have this little problem for which I'm hoping to outsource the solution.
My current job involves doing leave audits. Not terribly exciting but it pays the bills. The audit is recorded on an Excel file which was created several years ago by my current supervisor. There's a little problem with the file which she never solved. It's not a major problem and it's easily fixed for each audit, but it strikes me that there should be a really simple solution.
The issue is long service leave. Here in Australia, Commonwealth employees are entitled to 90 calendar days of long service leave after 10 years of service, and an extra 9 days per year after that.
The file involves you specifying the date the employee started with the agency. The file then adds 10 years to the start date, which thus provides the date the employee is eligible for their first 90 days of long service leave. Then, in the cell below the 10th anniversary date, we want the file to show the date one year later, and so on down the file, up to the last anniversary date before today.
So, for example, an employee starting on 21 December 2002 would have their 10th anniversary on 21 December 2012, and then anniversaries on 21 December 2013 and 2014 (and would now have a total of 108 days of leave, minus any leave taken).
The solution used by my supervisor to calculate these anniversary dates was to add 365 days to the previous anniversary (that is, 21/12/2012 + 365 days = 21/12/2013). But the problem (as she herself recognised) is those pesky leap years. Thus, every four years 366 days need to be added instead.
Presumably the solution is to replace "+365" with some sort of "If-Then" formula. But I'm unsure how to write it. Does anyone have any suggestions?
Thank you.