Help to automate a calculation

Paterson

New Member
Joined
Jan 8, 2018
Messages
10
Hi everyone! How are you Doing?
Hope everything is fine.

Dear friends, Where I am working, every employee have a total of 15 days of vacations after each year of work.
But after each 3 years of work, they add one more day per year.

So let me illustrate that in a clearer example:

Let's take an Employee Jhon, who starts working february 15th, 2010:

Date Vacations
febrary 15th, 2011 = 15 days of vacations
febrary 15th, 2012 = 15 days of vacations
febrary 15th, 2013 = 16 days of vacations( 1 more day because he reaches 3 years of work)

febrary 15th, 2014 = 16 days of vacations
febrary 15th, 2015 = 16 days of vacations
febrary 15th, 2016 = 17 days of vacations( 1 more day because he reaches another 3 years of work)

febrary 15th, 2017 = 17 days of vacations
febrary 15th, 2018 = 17 days of vacations
febrary 15th, 2019 = 18 days of vacations( 1 more day because he reaches 3 more years of work)

and this will continue to repeat each 3 more years.


I am working on an Excel workhook to automatically do this operation.

so that i can just put the name of the person, the starting date and excel will do the rest:
Like This:

From the above example:
Name : Jhon
Starting Date : february 15th, 2010
Total vacations on the actual date: ( here goes the sum of all the days of vacations since the starting date to the actual date. So if the actual date was febrary 15th, 2019, the sum should be 147 days. (No matter what the sum shows decimal number if the actual date doesn't reach one complete year )

It sounds a little difficult (Maybe for me)
Please!
Is there a tricks or a VBA code to do this? I am thinking about it and still can't figure out how to do it.
Any help would be thankfull.

Thanks in advance.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I would create a lookup table on separate sheet that lists the number of vacation days for each year worked, as well as the total days built up:

1 15 15
2 15 30
3 16 46
4 16 62
5 16 78
6 17 95
7 17 112
8 17 129
9 18 147
etc...

Then you calculate the rounded number of years using =ROUNDDOWN(YEARFRAC(start_date, TODAY()),0)
And then use a VLOOKUP in the table, based on the number of years you just calculated

Hope this helps
JL


 
Upvote 0
I would create a lookup table on separate sheet that lists the number of vacation days for each year worked, as well as the total days built up:

1 15 15
2 15 30
3 16 46
4 16 62
5 16 78
6 17 95
7 17 112
8 17 129
9 18 147
etc...

Then you calculate the rounded number of years using =ROUNDDOWN(YEARFRAC(start_date, TODAY()),0)
And then use a VLOOKUP in the table, based on the number of years you just calculated

Hope this helps
JL




Thanks Dear, From your idea I was able to solve the problem.
Take care,
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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
Back
Top