Если ваши данные в столбце А. Результат медианы будет записан в столбце с.
Sub test()
Dim rngDB As Range, rng As Range
Dim vR() As Variant
Dim i As Long, n As Long
Set rngDB = Range("a1", Range("a" & Rows.Count).End(xlUp))
For i = 1 To rngDB.Rows.Count Step 5
Set rng = Range("a" & i).Resize(5)
n = n + 1
ReDim Preserve vR(1 To n)
vR(n) = WorksheetFunction.Median(rng)
Next i
Range("c1").Resize(n) = WorksheetFunction.Transpose(vR)
End Sub