Wonderful. I changed the "S" to "K" due to the formulae in rows 44 and 74 that use "SI" for shifted in learners.
"Sick" absences should also be included in the below code that count the number of learners with more than 5 consecutive absences. Please help again,
Code:
Function CountOfRowsWithNOrMoreConsecutiveXs(myRange, N)
Vals = myRange.Value
For rw = 1 To UBound(Vals)
ThisRowCount = 0
For colm = 1 To UBound(Vals, 2)
If InStr(1, UCase(Vals(rw, colm)), "X") > 0 Then ThisRowCount = ThisRowCount + 1 Else ThisRowCount = 0
If ThisRowCount >= N Then
RowCount = RowCount + 1
Exit For
End If
Next colm
Next rw
CountOfRowsWithNOrMoreConsecutiveXs = RowCount
End Function
Thank you.