Sub DistributeByIntervals()
Dim i As Integer, a As Integer, b As Integer, c As Integer
Dim j As Integer, k As Integer, l As Integer, v As Integer
a = 0: b = 0: c = 0
j = 2: k = 2: l = 2
For i = 2 To 31
v = Cells(i, 8).Value
If v >= 13 And v <= 22 Then
Cells(j, 10).Value = v
j = j + 1
a = a + 1
ElseIf v >= 23 And v <= 32 Then
Cells(k, 11).Value = v
k = k + 1
b = b + 1
ElseIf v >= 33 And v <= 42 Then
Cells(l, 12).Value = v
l = l + 1
c = c + 1
End If
Next i
Cells(j, 10).Value = "Всего: " & a
Cells(k, 11).Value = "Всего: " & b
Cells(l, 12).Value = "Всего: " & c
End Sub