inkserious
Technical User
- Jul 26, 2006
- 67
I, along with some help, put this formula together some time ago to calculate employee attendance. We use a point system, and after 90 consecutive days of perfect attendance, we remove one point. I had to add the INDEX function to allow for some special circumstances: we do not give points for Jury Duty "JUR", Bereavement "BER" or FMLA "FMLA"; however, we still log them for tracking purposes. Originally, I had the formula set to ignore any absences that fell under these types. However, a problem has surfaced; although we do not assess points for an employee when they are absent due to FMLA, we are not going to count that day toward the 90 day perfect attendance window. Hence, if they had an absence due to FMLA, they would have to go 91 days since their previous absence. I'm struggling to find a way to tell the formula to add a day to the 90 day window for each FMLA day it finds.
I know this is long winded, and I hope it makes sense. Any help would be greatly appreciated. -ep
Column D contains the date of the absence
Column F contains the absence type: Absent, Late, FMLA, etc.
Column G contains the number of points assessed.
Column H contains the following formula used to calculate the roll-off.
{=IF(OR($D12=0,$G12<=0),"",IF($D13-$D12>90,-1,IF(AND($D13="",$G12>0,TODAY()-$D12>90),-1,-(INDEX($D13:$D$100,MIN(IF(($D13:$D$100<=TODAY())*($F13:$F$100<>"BER")*($F13:$F$100<>"JUR")*($F13:$F$100<>"FMLA"),ROW($F13:$F$100)-ROW(D12),"")))-$D12>90))))}
I know this is long winded, and I hope it makes sense. Any help would be greatly appreciated. -ep
Column D contains the date of the absence
Column F contains the absence type: Absent, Late, FMLA, etc.
Column G contains the number of points assessed.
Column H contains the following formula used to calculate the roll-off.
{=IF(OR($D12=0,$G12<=0),"",IF($D13-$D12>90,-1,IF(AND($D13="",$G12>0,TODAY()-$D12>90),-1,-(INDEX($D13:$D$100,MIN(IF(($D13:$D$100<=TODAY())*($F13:$F$100<>"BER")*($F13:$F$100<>"JUR")*($F13:$F$100<>"FMLA"),ROW($F13:$F$100)-ROW(D12),"")))-$D12>90))))}