I'm trying to build a workflow that have three columns as input (Column A, Column B and a search value) and output the result as the value in 'Desired Output' column. Basically search the target for example "ABC" in a list of strings "ABC","ABC22","3sABC" and only return 1 match result "ABC".

I used formula tool in Alteryx with function Contains but in my cases above, the result is the target is contained in both A value and B value. I can't use filter because I've a list of different Search Target value in my real dataset.
Thank you for your help in advance. Any ideas for how to build this workflow would be helpful.