If you can create help column G like:
and put something like (into E3)![]()
=H3&I3
Formula:
=IFERROR(INDEX(J:J,MATCH("*"&INDEX(A3:D3,MATCH(1,COUNTIF($G$3:$G$19,"*"&A3:D3&"*"),0))&"*",G:G,0)),"")
accept with CSE and drag it down
Not tested so intensively.
Bookmarks