Hi,
I'm trying to have a formula to calculate my sick paid and sick unpaid. The allowance for the whole year is 3 days paid=24 hours. The rest needs to go to unpaid column. However, in each period this rule needs to be checked for in the previous period as well. If I reach 24 hrs in week 1 and I am sick again in week 2, the sick leave will go to unpaid.
I've been using the below but it keeps transferring to each week - so I have 3x SL in PERIOD1WK1 and I can see the same amount of sick hours again in wk2. In week 2 this column should equal to 0 and Sick unpaid should kick in.
=LET(prevSickPd,SUMIFS($K8:W8,$K$7:W$7,"Sick Paid"),totalSickPd,COUNTIFS($K8:W8,"SL",$K$7:W$7,"Shift")*8,currentSickPd, totalSickPd - prevSickPd,MEDIAN(24-prevSickPd,currentSickPd,0))
Thank you.
Lucie.
Bookmarks