View Single Post
 
Old 10-17-2019, 04:55 AM
Marcia's Avatar
Marcia Marcia is offline Windows 7 32bit Office 2013
Expert
 
Join Date: May 2018
Location: Philippines
Posts: 527
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default

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.
Attached Files
File Type: xlsm FORM.SY 2019-2020 - Copy.xlsm (144.8 KB, 5 views)
Reply With Quote