give this a try
Function AbnormalTotal(rng As Range, DoV As Date) As Long
Dim Num As Long, Ccell As Range
Num = 0
For Each Ccell In rng.Cells
If IsDate(Ccell.Value) Then
If Ccell.Value > DoV Then
If Ccell.Offset(0, -1) = "abnormal" Then
Num = Num + 1
End If
End If
End If
Next Ccell
AbnormalTotal = Num
End Function
Function NormalTotal(rng As Range, DoV As Date) As Long
Dim Num As Long, Ccell As Range
Num = 0
For Each Ccell In rng.Cells
If IsDate(Ccell.Value) Then
If Ccell.Value > DoV Then
If Ccell.Offset(0, -1) = "normal" Then
Num = Num + 1
End If
End If
End If
Next Ccell
NormalTotal = Num
End Function
i did not check your logic
Bookmarks