Here's the adjusted formula to your new layout

=IFERROR(INDEX($F$4:$F$15,MIN(IF(ISNUMBER(SEARCH($E$4:$E$15,A2)),ROW($E$4:$E$15)-ROW($E$4)+1,99))),".")