This setup isn't readily generalizable, though since you confirmed that the number of list entries, rows, and columns is fixed:
=LET(α,SEQUENCE(64199,,12345),β,MMULT(0+ISNUMBER(FIND(SEQUENCE(,7),α)),SEQUENCE(7)^0)=5,0+MID(INDEX(SORT(CHOOSE(SEQUENCE(,2),FILTER(α,β),RANDARRAY(SUM(N(β)))),2),SEQUENCE(100)),SEQUENCE(,5),1))