Formula or other to determine amount of vacation weeks

bh24524

Active Member
Joined
Dec 11, 2008
Messages
365
Office Version
  1. 365
  2. 2007
Hello, so I am looking to see if a formula or other could assign an asterisk to when someone will be due a new vacation in the year based on how long they have been with the company. There are several conditions though, if they are Union employees or non-union, and in the case of Union depending on if they were hired after a certain year. I will explain those below the schedule of when employees actually earn their vacation.

How many years from hire date (UNION)
1 year = 1 week of vacation
3 years = 2 weeks vacation
8 years = 3 weeks vacation
14 years = 4 Weeks vacation
20 years = 5 weeks vacation
25 years = 6 weeks vacation

Here are the special conditions mentioned above for Union employees:

If they were hired before 2002, they can get up to 6 weeks
If they were hired on or after 2002 but before 2016, they can get up to 5 weeks
If they were hired in 2016 or after, they can only get up to 4 weeks

Here is the schedule of vacations for Non-Union employees

6 months = 1 week vacation
1 year = 2 weeks vacation
5 years = 3 weeks vacation however, they do not get this extra week until January 1st of what would be their 6th year
14 years = 4 weeks vacation however, they do not get this extra week until January 1st of what would be their 15th year
19 years = 5 weeks vacation however, they do not get this extra week until January 1st of what would be their 20th year

So in our vacation software which is unfortunately very out of date, the way it works is it does calculate those amount of weeks due as mentioned. We run a report which will generate charts by department that has their total amount of weeks they are entitled to and a blank box next to it where the asterisk mentioned above will go. However, the way it is programmed it will only give an asterisk in that separate box to those who are to get ONE week in that year. It does not work for any of the years after that.

So that is where maybe a formula could come in I hope. Bear in mind, Union charts are separated from Non-union charts so it may end up that I would have 2 formulas. The number of weeks they earn starts in D11 and goes down from there by how many employees are on that chart. The asterisk would start in D12 and go down from there depending on how many employees are on that chart. So based on the information and criteria I have given above, is there some formula or other I can utilize in the excel charts that are generated that will put the asterisk in the cells if they are getting an additional week that year?
 
Last edited:

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
[TABLE="width: 1231"]
<colgroup><col span="5"><col><col><col><col span="3"><col><col span="2"><col><col span="3"></colgroup><tbody>[TR]
[TD="colspan: 5"]How many years from hire date (UNION)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 4"]1 year = 1 week of vacation[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]unionyrs[/TD]
[TD]vac[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]3 years = 2 weeks vacation[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]8 years = 3 weeks vacation[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 4"]14 years = 4 Weeks vacation[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 4"]20 years = 5 weeks vacation[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 4"]25 years = 6 weeks vacation[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 7"]Here are the special conditions mentioned above for Union employees:[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]6[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]99[/TD]
[TD="align: right"]6[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 7"]If they were hired before 2002, they can get up to 6 weeks[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 8"]If they were hired on or after 2002 but before 2016, they can get up to 5 weeks[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 7"]If they were hired in 2016 or after, they can only get up to 4 weeks[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]nonunionyrs[/TD]
[TD]vac[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 6"]Here is the schedule of vacations for Non-Union employees[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]0.5[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 4"]6 months = 1 week vacation[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 3"]1 year = 2 weeks vacation[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 12"]5 years = 3 weeks vacation however, they do not get this extra week until January 1st of what would be their 6th year[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 12"]14 years = 4 weeks vacation however, they do not get this extra week until January 1st of what would be their 15th year[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]99[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 12"]19 years = 5 weeks vacation however, they do not get this extra week until January 1st of what would be their 20th year[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]JOINED[/TD]
[TD]SERVICE[/TD]
[TD]UNIONMAX[/TD]
[TD]NONUMAX[/TD]
[TD]vacallowance[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name1[/TD]
[TD]U[/TD]
[TD="align: right"]1990[/TD]
[TD="align: right"]28[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD]####[/TD]
[TD][/TD]
[TD="colspan: 3"]with 2 tables defining allowances[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name2[/TD]
[TD]NONU[/TD]
[TD="align: right"]1990[/TD]
[TD="align: right"]28[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name3[/TD]
[TD]U[/TD]
[TD="align: right"]1994[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]formula in #####[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name4[/TD]
[TD]NONU[/TD]
[TD="align: right"]1994[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name5[/TD]
[TD]U[/TD]
[TD="align: right"]1998[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 7"]=IF(C24="U",VLOOKUP(E24,uniontable,2),VLOOKUP(E24,nonuniontable,2))[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name6[/TD]
[TD]NONU[/TD]
[TD="align: right"]1998[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name7[/TD]
[TD]U[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name8[/TD]
[TD]NONU[/TD]
[TD="align: right"]2000[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 4"]you can adjust the values in the lookup tables[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name9[/TD]
[TD]U[/TD]
[TD="align: right"]2003[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name10[/TD]
[TD]NONU[/TD]
[TD="align: right"]2003[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name11[/TD]
[TD]U[/TD]
[TD="align: right"]2005[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name12[/TD]
[TD]NONU[/TD]
[TD="align: right"]2005[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name13[/TD]
[TD]U[/TD]
[TD="align: right"]2009[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name14[/TD]
[TD]NONU[/TD]
[TD="align: right"]2009[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name15[/TD]
[TD]U[/TD]
[TD="align: right"]2011[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name16[/TD]
[TD]NONU[/TD]
[TD="align: right"]2011[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name17[/TD]
[TD]U[/TD]
[TD="align: right"]2014[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name18[/TD]
[TD]NONU[/TD]
[TD="align: right"]2014[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name19[/TD]
[TD]U[/TD]
[TD="align: right"]2016[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name20[/TD]
[TD]NONU[/TD]
[TD="align: right"]2016[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name21[/TD]
[TD]U[/TD]
[TD="align: right"]2017[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name22[/TD]
[TD]NONU[/TD]
[TD="align: right"]2017[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name23[/TD]
[TD]U[/TD]
[TD="align: right"]2018[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]name24[/TD]
[TD]NONU[/TD]
[TD="align: right"]2018[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
There is a hidden function within Excel called DATEDIF that could be perfect for this. I say "hidden" because you won't find it in Excel help, but you can use it like a normal function.

If column A has type ("Union" or "Non-Union") and column B has start dates (Excel dates, not just years), try this in C2:

Code:
=IF(A2="Union",MIN(VLOOKUP(DATEDIF(B2,TODAY(),"y"),{1,1;3,2;8,3;14,4;20,5;25,6},2),CHOOSE(MATCH(YEAR(B2),{1900,2002,2016}),6,5,4)),VLOOKUP(DATEDIF(B2,DATE(YEAR(TODAY()),1,1),"m"),{6,1;12,2;60,3;168,4;228,5},2))

Here, DATEDIF(B2,TODAY(),"y") will return the integer value of full years between the start date and today. Similarly, DATEDIF(B2,DATE(YEAR(TODAY()),1,1),"m") will return the integer value of full months between the start date and Jan 1 of the current year.

I'd recommend putting the two arrays in tables on a different sheet instead of listing them within the { }s of the formula above, but this illustrates that you actually *can* do this calculation within one formula if you wanted to.
 
Upvote 0
There is a hidden function within Excel called DATEDIF that could be perfect for this. I say "hidden" because you won't find it in Excel help, but you can use it like a normal function.

If column A has type ("Union" or "Non-Union") and column B has start dates (Excel dates, not just years), try this in C2:

Code:
=IF(A2="Union",MIN(VLOOKUP(DATEDIF(B2,TODAY(),"y"),{1,1;3,2;8,3;14,4;20,5;25,6},2),CHOOSE(MATCH(YEAR(B2),{1900,2002,2016}),6,5,4)),VLOOKUP(DATEDIF(B2,DATE(YEAR(TODAY()),1,1),"m"),{6,1;12,2;60,3;168,4;228,5},2))

Here, DATEDIF(B2,TODAY(),"y") will return the integer value of full years between the start date and today. Similarly, DATEDIF(B2,DATE(YEAR(TODAY()),1,1),"m") will return the integer value of full months between the start date and Jan 1 of the current year.

I'd recommend putting the two arrays in tables on a different sheet instead of listing them within the { }s of the formula above, but this illustrates that you actually *can* do this calculation within one formula if you wanted to.

To be honest, I don't know that either of these solutions would work. Let me clarify further, there are many departments which cause the excel charts to be generated. There are many charts from the union and there are many different ones from the non-union. These charts get sent down for employees to put X's in the dates across the boxes. I'm really just looking for a function for the asterisk that I mentioned, one that I can just copy to all those charts. I know that seems tedious but it will actually save a lot more time than me just looking at every person on every chart to determine if they are getting a vacation that year. Is there perhaps a different solution? As I said if we need one formula for teh union charts and one for the non-union charts, I can live with that.
 
Upvote 0
In every company that I ever worked for, holidays were booked by submitting a holiday request for one or more days. If approved, an "X" was placed in a box for each day in a spreadsheet maintained by HR that was read only to employees. That spreadsheet had the annual entitlement and days remaining for that holiday year.My solution allows you to calculate that annual holiday entitlement.
 
Upvote 0
I do think the principles of my previous post would allow you to get the asterisk you're looking for.

Instead of just using this portion of the formula from my previous post to return the number of vacation weeks an employee receives:
Code:
=MIN(VLOOKUP(DATEDIF(B2,TODAY(),"y"),{1,1;3,2;8,3;14,4;20,5;25,6},2),CHOOSE(MATCH(YEAR(B2),{1900,2002,2016}),6,5,4))

consider changing the TODAY() part to the relevant end dates.

For example, if you want to return an asterisk only where people have more vacation weeks this year than they did last year, you could use something like:

Code:
=IF(MIN(VLOOKUP(DATEDIF(B2,TODAY(),"y"),{1,1;3,2;8,3;14,4;20,5;25,6},2),CHOOSE(MATCH(YEAR(B2),{1900,2002,2016}),6,5,4))>MIN(VLOOKUP(DATEDIF(B2,EDATE(TODAY(),-12),"y"),{1,1;3,2;8,3;14,4;20,5;25,6},2),CHOOSE(MATCH(YEAR(B2),{1900,2002,2016}),6,5,4)),"*","")

Not sure if you're looking to specifically use today's date or if you should instead use Jan 1 of this year and last year... regardless, I wouldn't dismiss this approach just yet.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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