I am new to IF logics and logics in general and I need help formating a formula.

I am also trying to use a "randomizer" macro to shuffle the names of my associates into different areas that they work.

Example:
A, B, C columns represent a who can work in a specific area. I need the formula to say IF A1=B1,C1,D1,E1,F1,G1,H1,I1,J1, etc. then choose A2. But then I also need it to say IF A2=B1, C1, D1, etc. then choose A3 and all the way down the line. I have no idea how to do this since I can only use a limited amount of IF logics.

could someone please help me get this formula together before I lose my mind?