Rehpot,
Welcome to the forum!
Attached is a modified version of your posted workbook.
The cell where you type in the unique number is H2
In cell H3 is this formula to get the data from column E (Prior):
=IF($H$2="","",IF(COUNTIF($A$2:$A$23,$H$2)=0,"No Matches",IF($H$2=$A$2,"",INDEX($E$2:$E$23,MATCH($H$2,$A$2:$A$23,0)-1))))
In cell H4 is this formula to get the data from column E (Next):
=IF($H$2="","",IF(COUNTIF($A$2:$A$23,$H$2)=0,"No Matches",IF($H$2=$A$23,"",INDEX($E$2:$E$23,MATCH($H$2,$A$2:$A$23,0)+1))))
Bookmarks