Forum Discussion
Find specific word within a text cell
Hi all,
I have a column with cells containing a lot of text.
I would like to create a column which looks for a certain word and return a specific value.
1.
For instance if I was to look for Apple -> return 'Yes' or 'No'
Can I make the code look for *app*' or does it need to be fully matching?
I would like to have to return entries like 'apple-like' for instance, or or 'apples'
I hope this makes sense, right now I'm using the 'add a conditional column' in the query, which is fine, but not taking all possibities into account.
Thanks
Kristoffer
Hello there KristofferAJ ! You can use the following:
Find word = IF ( CONTAINSSTRING ( 'Your_Table'[Your_column], "*app*" ), "Yes", "No" )Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes
3 Replies
- goncalogeraldes
Super User
Hello there KristofferAJ ! You can use the following:
Find word = IF ( CONTAINSSTRING ( 'Your_Table'[Your_column], "*app*" ), "Yes", "No" )Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes - KristofferAJ
Helper III
Hi, this is great and does the job! - let's say that I want it to look for multiple words, like orange also? can that be built in?
Find word =
IF ( CONTAINSSTRING ( 'Your_Table'[Your_column], "*app*" ), "Yes", "No" )
OR
( CONTAINSSTRING ( 'Your_Table'[Your_column], "*oran*" ), "Yes", "No"- goncalogeraldes
Super User
Hello there KristofferAJ ! You can simply do:
Find word = IF ( OR ( CONTAINSSTRING ( 'Your_Table'[Your_column], "*app*" ), CONTAINSSTRING ( 'Your_Table'[Your_column], "*oran*" ) ), "Yes", "No" )For additional help, please @ me in your reply!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes