Please check the file first. https://docs.google.com/spreadsheets/d/1wYq9BEESpu77wvJzQY1AE4Gmr_PhhaNFSik0ZZt8aD0/edit?usp=sharing My purpose is:
We can't split values to single columns because those data can be added more value in future.
try:
=QUERY({RANDARRAY(ROWS(A2:A)), A2:G}, "select Col2 where 9=9 "&
IF(J11="",," and Col3 contains '"&J11&"' ")&
IF(J12="",," and Col4 contains '"&J12&"' ")&
IF(J13="",," and Col5 contains '"&J13&"' ")&
IF(J14="",," and Col6 contains '"&J14&"' ")&
IF(J15="",," and Col7 contains '"&J15&"' ")&
"order by Col1 limit 1")