Of course i can have a formula which is becoming cumbersome and complex. so I have given a macro.
Dim j As Integer, k As Integer, r As Range, x As Double, rmax As Range
j = Range("A1").End(xlDown).Row
For k = 1 To j Step 4
Set r = Range(Cells(k, 1), Cells(k + 3, 1))
x = WorksheetFunction.Max(r)
Set rmax = Cells(WorksheetFunction.Match(x, r, 0), "b")
Cells(k, "C").Value = rmax
suppose there are two maximums in a subset e.g. a1 to a4 then it will take the corresponding B value only for the first maximum .