Hi, If you've got it working you'll notice you have the Average/Max but no years.
This code should address that.
Column "C" should now show the year taken from column "A" (Dates) and Column "D" should show the Max/Average Result relating to that year.
If its not quite working Correctly , perhaps you could post you File (.xls).
Sub AvMx()
Dim LastYr As Integer, FirstYr As Integer, c, Mx As Single, Yr As Integer
Dim Av As Single, n As Integer
c = 1
LastYr = Year(Cells(Range("A" & Rows.Count).End(xlUp).Row, "A").Value)
FirstYr = Year(Cells(1, "A").Value)
For Yr = FirstYr To LastYr
Do While Year(Cells(c, "A").Offset(2)) = Yr
Av = Application.Average(Range(Cells(c, "B"), Cells(c, "B").Offset(2)))
Mx = Application.Max(Av, Mx)
c = c + 1
Loop
n = n + 1
Cells(n, "C") = Yr
Cells(n, "D") = Mx
Mx = 0
Next Yr
End Sub
Regards Mick
Bookmarks