SEARCH function with multiple conditions
Solved
Erakmur
-
docteurdam -
docteurdam -
Hello,
In column A, I have several thousand cells with text. When I ask Excel to indicate if the term D1 exists in the cell, I write =SEARCH("D1",A1) and it returns a number if it finds the term D1 in A1. Then I filter all the cells containing a number, which gives me all the cells that have D1 in their text.
Now, if I ask Excel to return a number if it finds either D1 or D2 in the cell, it doesn't work anymore. I tried =SEARCH(OR("D1","D2"),A1) and other techniques, but it doesn't work.
Does anyone have a solution?
Best regards
In column A, I have several thousand cells with text. When I ask Excel to indicate if the term D1 exists in the cell, I write =SEARCH("D1",A1) and it returns a number if it finds the term D1 in A1. Then I filter all the cells containing a number, which gives me all the cells that have D1 in their text.
Now, if I ask Excel to return a number if it finds either D1 or D2 in the cell, it doesn't work anymore. I tried =SEARCH(OR("D1","D2"),A1) and other techniques, but it doesn't work.
Does anyone have a solution?
Best regards
10 réponses
Hello
if you have a large number of reference texts to search, you can:
make a list of these references from D1 to D10 for example (without any empty cells)
in C1, the formula to drag down to the useful height
=SUMPRODUCT((COUNTIF(A1,"*"&$D$1:$D$10&"*"))*1)
which returns 1 if A contains a text from D1:D10 or 0 otherwise.
pay attention to all the signs
best regards
--
To err is human, to persist is diabolical
if you have a large number of reference texts to search, you can:
make a list of these references from D1 to D10 for example (without any empty cells)
in C1, the formula to drag down to the useful height
=SUMPRODUCT((COUNTIF(A1,"*"&$D$1:$D$10&"*"))*1)
which returns 1 if A contains a text from D1:D10 or 0 otherwise.
pay attention to all the signs
best regards
--
To err is human, to persist is diabolical
thank you+++