Question

I am trying to calculate leave entitlement based on the date of joining and current date, at antry date the person has 20 days of leave if the person has completed their 2nd year anniversary by 01 April then they would get 4 extra days.

E.G.

  • if joining date is 15/03/18 annual leave = 24 (completed 2 years by 01 April of current year 2020)
  • if joining date is 15/06/18 annual leave = 20 (has not completed 2 full yeas by 01 April of current year 2020)

I have he excel formula which works perfectly:

=20+(EDATE(A2,24)<=DATE(YEAR(TODAY()),4,1))*4

I have been trying to apply the same principal on a calculated column in a SharePoint Library Where I had a Joining Date and a Leave column; I have twicked the code below but it does not work

=20+(DATE([Joining Date])<=DATE(YEAR(TODAY()),4,1))*4

Any ideas on how I can solve this?

Was it helpful?

Solution

You can try below and let me know if that meets your requirements

=IF(DATEDIF(JoiningDate,DATE(YEAR(TODAY()),4,1),"d")>=(365*2),24,20)

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top