Pro-rated leave for range

ambz123

Board Regular
Joined
Aug 27, 2020
Messages
53
Office Version
  1. 2019
Platform
  1. Windows
Hi,

I am task to create a leave management that auto calculates the pro-rated leave entitlement based on the following condition.

If the employee is Manager he will be entitled to 16 days of annual leave but it has to be pro-rated in accordance to his join date and less than 2 years is 16 days, 2 years but less than 5years of service is 18 days, 5 years and above is 20 days.

While if the employee is Executive he will be entitled to 14 days of annual leave but same thing, the 14 days will be pro-rated in accordance to his join date when he first join the company. Less than 2 years is 14 days, 2 years but less than 5years of service is 16 days, 5 years and above is 18 days.

Need some help in this.
1609399806829.png

Thank you.
 

maabadi

Well-known Member
Joined
Oct 22, 2012
Messages
1,822
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
I don't Understand what you say exactly. if means with workers less than 3 month working formula return zero.
Excel Formula:
=If(G2<3,0,IF(F2="M",IF(G2<=24,16,IF(G2<=60,18,20)),IF(F2="ESO",IF(G2<=24,14,IF(G2<=60,16,18)),IF(F2="TFO",IF(G2<=24,10,IF(G2<=60,12,16)),IF(G2<=24,8,IF(G2<=60,10,12))))))
If you want Use Column D not G then Change all G2 at formula to :
Excel Formula:
MONTH(NOW()-D2)-1
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

ambz123

Board Regular
Joined
Aug 27, 2020
Messages
53
Office Version
  1. 2019
Platform
  1. Windows
Hi for instant a Staff joined on 5/10/2020, his Job Code is ESO his AL entitlement after 1 year is 14 days. It should return value as 3.5 as the number of month join is 3 months. How do i use the formula to return the value as 3.5?

how i get 3.5 is 3/12*14 = 3.5
=ROUND(IF(DATEDIF([@[JOIN DATE]],$D$2,"M")<3,0,IF(DATEDIF([@[JOIN DATE]],$D$2,"Y")<1,([@[AL Entitlement]]*(DATEDIF([@[JOIN DATE]],$D$2,"M"))/12),MIN(16,[@[AL Entitlement]]+((DATEDIF([@[JOIN DATE]],$D$2,"M")-12)/12))))/0.5,0)*0.5

I tried the above formula but it doesnt populated based on their job code instead i have to filter by their job code and amend one by one based on their job code. Is there anyway whereby i can add in the job code condition the the above formula so that it can return the accurate value based the condition of Job code, follow by years of entitlement, follow by pro-rated leave entitlement.

Date JoinJob CodeNo. of MonthsAL EntitlementCurrent Accrued
5/10/2020ESO3
Excel Formula:
=DATEDIF([@[JOIN DATE]],TODAY(),"m")
143.5
Excel Formula:
=ROUND(IF(DATEDIF([@[JOIN DATE]],$D$2,"M")<3,0,IF(DATEDIF([@[JOIN DATE]],$D$2,"Y")<1,([@[AL Entitlement]]*(DATEDIF([@[JOIN DATE]],$D$2,"M"))/12),MIN(16,[@[AL Entitlement]]+((DATEDIF([@[JOIN DATE]],$D$2,"M")-12)/12))))/0.5,0)*0.5
 

maabadi

Well-known Member
Joined
Oct 22, 2012
Messages
1,822
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Please upload your Example file & Desired Result with minimum 10 rows with XL2BB ADDIN (Preferable) or upload it to free hosting site e.g. www.dropbox.com or Google Drive or OneDrive and input link here.
 

ambz123

Board Regular
Joined
Aug 27, 2020
Messages
53
Office Version
  1. 2019
Platform
  1. Windows
Hi i tried to upload but cant seems to work
 

Attachments

  • Capture.PNG
    Capture.PNG
    29.6 KB · Views: 3

Watch MrExcel Video

Forum statistics

Threads
1,129,922
Messages
5,639,018
Members
417,062
Latest member
CM214

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