Hi,
Maybe in your actual database formulas could need an extra "*" to work properly.
=IF(COUNTIF($C$2:$C$18,"*"&A2&" *"&B2&"*"),"YES","")
or you could need to check if the two substrings appear in different order:
=IF(COUNTIF($C$2:$C$18,"*"&A2&" *"&B2&"*")+COUNTIF($C$2:$C$18,"*"&B2&" *"&A2&"*"),"YES","")
More or less same formulas.
I hope it's of some help.
Regards