Formula Search Loop - Search table for match of record in a different table
Hello!!! I am seeking assistance with my formula. I am trying to do something like an Index/ Match kind of deal with my table. I have a table of people onboarded. I have another table that lists leaders and their position. the user will enter 2 fields for each person onboarded "Referred by" and "Primary Leader". I am looking to have a formula that will check to see if the name in the "referred by" section is in the leaders table. if so, then put their name. if not, check to see if the person in "primary leader" is in the leader table and if so return that name. if not, then search for the name that matches the primary leader in the people onboarded table and check to see if their primary leader is in the leader table and if so, return that name. and loop until it finds a name in the leader table. I was able to do it in Excel with a formula but cant figure out how to get it in QB. Any help would be appreciated!
------------------------------
Christina Derhay
------------------------------