I have a list of words I need to get from a text string:
- A cow
- Dog-boy
- Hello-get it
(just random words)
I have multiple cells with random words surrounding desired ones:
- Random wordlsads A cow askjdhakj
- sla;alsj Dog-Boy l;sasla
- skla Hello-get it ksalksajsa
And I need an excel function to extract my specified words from this cell. The problem is that I need 1 universal formula that checks all words in a string and returns if something matches one of the words in a list.
I would use following function to extract one word from 1 cell:
=TRIM(MID(D4,SEARCH(R3,D4),LEN(R3)))
Where D4 is a text string I need to check and R3 is a word I am looking for.
I was trying to combine those using IFS formula:
=TRIM(IFS($R$4=MID(D2,SEARCH($R$4,D2),LEN($R$4)),$R$4,$R$2=MID(D2,SEARCH($R$2,D2),LEN($R$2)),$R$2))
But, as some of you already get, it returns #VALUE! error, because when first SEARCH formula runs and does not find any match it returns #VALUE! error and whole function returns it, despite the fact that it could actually have 1 TRUE result.
I googled a lot and, as I understand, I need to use TRANSPOSE formula to create an array, and somehow get result from there, but, I guess, I am not that smart yet.
Would appreciate some help on this one. Thank you!