Please refer to the steps in the 'Data' table. RELATED() and LOOKUPVALUE() are similar to Merge Query. the last IF() can be slightly modified in the code of the condition column.
Best Regards, Gao Community Support Team
If there is any posthelps, then please considerAccept it as the solutionto help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know.Thanks a lot!