Forum Discussion
Search amd exclude certain strings
Hi, I have the search function but want to exclude certain strings.
Ball= IF (ISBLANK ( SEARCH ( "Messi", Table[Column], 1, BLANK () ) ),
0,
1
)
It gives me 1 or 0 depending if Messi is in the string. I want to add exclusion for Ronaldo and Pogba. So if Messi only is in the string it is 1, if "Messi and Ronaldo or Pogba" are it is 0.
'Messi is great' the result is 1
'Messi and Ronaldo are great' the result is 0
'Messi and Ronaldo or Pogba are great'the result is 0
Ball = IF (NOT(ISBLANK ( SEARCH ( "Messi", 'Table'[Column], 1, BLANK () ) )) && ISBLANK ( SEARCH ( "Ronaldo", 'Table'[Column], 1, BLANK () ) ) && ISBLANK ( SEARCH ( "Pogba", 'Table'[Column], 1, BLANK () ) ), 1, 0)
15 Replies
- parry2k
Super User
Ball= IF ( ISBLANK ( SEARCH ( "Messi", Table[Column], 1, BLANK () ) ) && ( ISBLANK ( SEARCH ( "Ronaldo", Table[Column], 1, BLANK () ) ) || ISBLANK ( SEARCH ( "Pogba", Table[Column], 1, BLANK () ) ) ) , 0, 1 )
- tomgag
Resolver I
Ball = IF (NOT(ISBLANK ( SEARCH ( "Messi", 'Table'[Column], 1, BLANK () ) )) && ISBLANK ( SEARCH ( "Ronaldo", 'Table'[Column], 1, BLANK () ) ) && ISBLANK ( SEARCH ( "Pogba", 'Table'[Column], 1, BLANK () ) ), 1, 0)
- parry2k
Super User
My code will work but if you got it resolved, tha'ts what all matters. There is always many way to do the things. Good for you!!
- v-piga-msft
Resident Rockstar
Hi tomgag,
It's glad that you have solved your problem. Please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
Best Regargds,
Cherry
- tomgag
Resolver I
None of your solutions worked I am afraid.