Forum Discussion

wktay's avatar
wktay
Copper Contributor
Sep 17, 2024

Excel Formula | Filter out a word from a table of words in another sheet Hi MS Community,

Hi MS Community,   I have the following worksheet. In the Orders Tab, I need to be able to filter out the "Fruit" from the "Sentence".   Sheet1 = Fruits Sheet2 = Orders   In Fruits:   ...
  • m_tarler's avatar
    Sep 17, 2024

    wktay 

    here are 2 options:

     

    =LET(a,TEXTJOIN(",",1,IF(ISNUMBER(SEARCH($I$1:$I$3,A1)),$I$1:$I$3,"")), IF(a<>"",a,"invalid"))

     

    or

     

    =IFERROR(TEXTJOIN(",",1,TEXTSPLIT(LOWER(A1),TEXTSPLIT(LOWER(A1),LOWER($I$1:$I$3),,1),,1)),"invalid")

     

    where A1 is the sentence cell and I1:I3 is the list of fruit

    notice that the first uses SEARCH so case ignored but needed the extra step if nothing found. in the second I could enclose an IFERROR but needed to convert everything to LOWER() to make case indepenent

Resources