Sub test()
Dim result
condit = "total"
Set rg_1 = Sheets(1).Range(Cells(2, 4), Cells(Application.Rows.Count, 4).End(xlUp))
For Each cel In rg_1
If cel = condit Then
tot = tot + cel.Offset(0, 1)
nb = nb + 1
End If
Next
result = tot / nb
MsgBox (result)
End Sub