May 04, 2021 08:01 AM
Hello there,
I have been using Airtable for a few years now and I absolutely love it.
I am creating a basic HR system for a startup and I want to create a formula for the employees’ paid leaves.
Basically, each employee should receive 2 days off for every month they work for. it should be added by the end of each month.
How do I automatically make it add up in Airtable, using the joining date only?
Is there a formula for that?
Thanks in advance.
Solved! Go to Solution.
May 04, 2021 10:42 AM
Try this simplified version of the much more complicated formula I use to calculate accrued amounts:
DATETIME_DIFF(TODAY(),{1st of First Accrual Month}, 'months') * 16
Its getting the number of whole months between right now and the first month that the employee began. Its multiplied by 16
to get the number of hours earned per month (assuming 2 days = 2 * 8 hours). Change 16
to 2
if you want whole days and not hours.
The above formula relies on a field called {1st of First Accrual Month}
which gets the first day of the month an employee began working. Its formula is DATETIME_FORMAT({Start Date},'YYYY-MM-01')
May 04, 2021 10:42 AM
Try this simplified version of the much more complicated formula I use to calculate accrued amounts:
DATETIME_DIFF(TODAY(),{1st of First Accrual Month}, 'months') * 16
Its getting the number of whole months between right now and the first month that the employee began. Its multiplied by 16
to get the number of hours earned per month (assuming 2 days = 2 * 8 hours). Change 16
to 2
if you want whole days and not hours.
The above formula relies on a field called {1st of First Accrual Month}
which gets the first day of the month an employee began working. Its formula is DATETIME_FORMAT({Start Date},'YYYY-MM-01')
May 04, 2021 11:31 AM
Thanks a million this is really helpful. I replaced the 16 with 2 and it worked!