Try this user definded function
Function GetCycleYear(StudentName, YearOfInterest, NameColumn, ReturnValueRow) As String
SourceRow = NameColumn.Find(StudentName, , xlValues, xlWhole).Row
YearColumn = NameColumn.Parent.Rows(SourceRow).Find(YearOfInterest, , xlValues, xlWhole).Column
GetCycleYear = NameColumn.Parent.Cells(ReturnValueRow.Row, YearColumn).Value
End Function
Open the VBA editor by hitting Alt F11.
Insert a new module with Insert - Module
Paste in the above function
Go back to the sheet by hitting Alt F11.
In Sheet2 F3, enter =GetCycleYear(B3,D3,Sheet1!A:D,Sheet1!$2:$2)
Remember to save the workbook as a macro enabled workbook .xlsm
Bookmarks