Calculating leave accruals based on time in service

frostym54

New Member
Joined
Nov 18, 2014
Messages
10
I am trying to have a formula that calculates time in service based on hire date and todays date and then giving the amount of leave hours per pay period.

0-4yeas = 4hours
5-9years = 5 hours
10+= 6 hours
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
A couple of examples would be very useful.


Excel 2010
ABCDEF
1StartTodayHoursBracketHours
25-May-1421-Sep-18404
310-Oct-0021-Sep-18655
4106
5or
65-May-1421-Sep-184
710-Oct-0021-Sep-186
1b
Cell Formulas
RangeFormula
C2=LOOKUP(DATEDIF(A2,B2,"y"),$E$2:$F$4)
C3=LOOKUP(DATEDIF(A3,B3,"y"),$E$2:$F$4)
C6=LOOKUP(DATEDIF(A6,B6,"y"),{0,4;5,5;10,6})
C7=LOOKUP(DATEDIF(A7,B7,"y"),{0,4;5,5;10,6})
 
Last edited:
Upvote 0
A couple of examples would be very useful.

Excel 2010
ABCDEF
1StartTodayHoursBracketHours
25-May-1421-Sep-18404
310-Oct-0021-Sep-18655
4106
5or
65-May-1421-Sep-184
710-Oct-0021-Sep-186

<colgroup><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
1b

Worksheet Formulas
CellFormula
C2=LOOKUP(DATEDIF(A2,B2,"y"),$E$2:$F$4)
C3=LOOKUP(DATEDIF(A3,B3,"y"),$E$2:$F$4)
C6=LOOKUP(DATEDIF(A6,B6,"y"),{0,4;5,5;10,6})
C7=LOOKUP(DATEDIF(A7,B7,"y"),{0,4;5,5;10,6})

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
Works great Thanks.
 
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,212
Members
449,214
Latest member
mr_ordinaryboy

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