Date Calculation

mtagliaferri

Board Regular
Joined
Oct 27, 2004
Messages
143
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)
Any suggestions?
Thanks
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,406
Office Version
  1. 365
Platform
  1. Windows
How about
+Fluff v2.xlsm
AB
1
215/03/201824
315/06/201820
401/04/201820
Main
Cell Formulas
RangeFormula
B2:B4B2=20+(EDATE(A2,24)<DATE(YEAR(TODAY()),4,1))*4


You may need to change the < to <= depending what should happen if they start on the 1st of April
 
Solution

mtagliaferri

Board Regular
Joined
Oct 27, 2004
Messages
143
How about
+Fluff v2.xlsm
AB
1
215/03/201824
315/06/201820
401/04/201820
Main
Cell Formulas
RangeFormula
B2:B4B2=20+(EDATE(A2,24)<DATE(YEAR(TODAY()),4,1))*4


You may need to change the < to <= depending what should happen if they start on the 1st of April
Thanks that is spot on!!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,406
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,262
Messages
5,635,140
Members
416,843
Latest member
mrbrown91b

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top