Hello all. We are using the following vacation accrual table (the 1st row is service months, the rest of the data is vacation accrual days, i.e. vacation flag 3 we would accrue 10 days for 28 months of employment):
I was hoping to use INDEX/MATCH to bring back the appropriate value based on the vacation flag and number of months of each employee (i.e. column a = name, column b = vacation flag, column c = # of months employed, column d = # of days to accrue based on the accrual table), but I cannot figure it out. I am getting confused because the number of service months will be all over the place. I was trying to adapt this formula (generously provided on this forum) but it's way above my head:
=SUMPRODUCT(--(H6>A$3:A$6),H6-A$3:A$6,INDEX(B$3:C$6,0,MATCH(E6,B$1:C$1,0))-INDEX(B$2:C$5,0,MATCH(E6,B$1:C$1,0)))
The references in the formula above are not the same as the current table we are using of course. I was just trying to figure out if something like this would work for our current accrual. Any help will be greatly appreciated. Thank you for your time.
Code:
Vacation Service Years
Flag 12 24 36 48 >49 >85
3 5 10 10 10 15 15
1 0 0 0 0 0 0
2 5 10 10 10 15 15
20 0 0 0 0 0 0
17 5 5 10 10 10 15
15 5 5 10 10 10 15
I was hoping to use INDEX/MATCH to bring back the appropriate value based on the vacation flag and number of months of each employee (i.e. column a = name, column b = vacation flag, column c = # of months employed, column d = # of days to accrue based on the accrual table), but I cannot figure it out. I am getting confused because the number of service months will be all over the place. I was trying to adapt this formula (generously provided on this forum) but it's way above my head:
=SUMPRODUCT(--(H6>A$3:A$6),H6-A$3:A$6,INDEX(B$3:C$6,0,MATCH(E6,B$1:C$1,0))-INDEX(B$2:C$5,0,MATCH(E6,B$1:C$1,0)))
The references in the formula above are not the same as the current table we are using of course. I was just trying to figure out if something like this would work for our current accrual. Any help will be greatly appreciated. Thank you for your time.