How to extract data that exclude a specific word in excel?

Hi, I want to extract the title contain “Global” (e.g. Global A), but exclude title that contain “indirect” (e.g. indirect Global A). The pic below shows the expression that i used, it would extract all the title, how to amend this expression or is there any other method to do so?


Hi @Katrina ,

In very generic terms, you could try this:

str_variable.ToLower.Contains("global") AndAlso Not(str_variable.ToLower.Contains("indirect"))

Kind Regards,
Ashwin A.K

Hi @Katrina

Try this

str_variable.ToUpper.Contains(“GLOBAL”) And Not(str_variable.ToUpper.Contains(“INDIRECT”))