I need to search a character column to look to see if each rows value contains specific strings and then create an indicator name/group accordingly in the new column (it will be searching for ~14 specific strings). I'm pretty sure nested IF() would be pretty slow... I have used Match() in the past when I want to match exact strings, but can I use wildcards?
I tried * and % but to no avail:
Match( :columnOfInterest,
"*StringA*", "String A",
"*StringB*", "String B",
"" )
I then tried to use Contains() within the Match() and still no luck:
Match( :columnOfInterest,
Contains(:columnOfInterest, "StringA"), "String A",
Contains(:columnOfInterest, "StringB"), "String B",
"" )
I see that Contains returns a numeric so I also tried adding > comparison and even wrapping in NUM():
Match( :columnOfInterest,
Contains(:columnOfInterest, "StringA") > 0, "String A",
Contains(:columnOfInterest, "StringB") > 0, "String B",
"" )
and
Match( :columnOfInterest,
Num(Contains(:columnOfInterest, "StringA")) > 0, "String A",
Num(Contains(:columnOfInterest, "StringB")) > 0, "String B",
"" )
any help is greatly appreciated. thanks!