The attached Excel workbook includes the data that corresponds with the two calculation needs associated with this question:
1) Need to fill Column C of the "ResultsTable" sheet with the day of year (DOY; in Column F of the "Data" sheet) that corresponds with the max depth for that year. If two DOY's have the same max depth, return the largest of the two DOY's
2) Need to fill Column D with the DOY that corresponds with the first zero value encountered subsequent to the value derived in Column C.
I manually populated the correct values for AllSeasYear = 1993.
Is there a good way to automate this with Excel functions?