Forum Discussion

Philippe_Nicod's avatar
Philippe_Nicod
Copper Contributor
Jul 19, 2022
Solved

IF: how to replace "true" with content from a specific cell?

hello dear Community,

 

I have a column B with a list of industries (doctor, hairdresser, garage, etc.)

and I have a column A with keywords (Super Car Garage, Clear Cut, doctor Martin, etc. ), for example in cell A1 is the phrase "Super Car Garage".

 

I would like to compare both columns: I want those cells in column A with contents matching the industries in column B to appear in column C with the matching content of column B, for example I want "garage" to be displayed in cell C1.

 

With the (french) formula =SI(OR(NB.SI(C9; "*"&$R$4:$R$2138&"*")); "yes";"") I have managed to identify that cell A contains one of the terms in column B. How can I make "garage" (the content of column B) appear instead of "yes"?

 

Thank you for your help!

  • Philippe_Nicod 

    =IFERROR(INDEX($B$1:$B$3,MATCH(TRUE,ISNUMBER(SEARCH($B$1:$B$3,A1)),0)),"")

    You can try this formula. Enter the formula with ctrl+shift+enter if you don't work with Office365 or 2021.

     

3 Replies

  • Philippe_Nicod 

    =IFERROR(INDEX($B$1:$B$3,MATCH(TRUE,ISNUMBER(SEARCH($B$1:$B$3,A1)),0)),"")

    You can try this formula. Enter the formula with ctrl+shift+enter if you don't work with Office365 or 2021.

     

    • Philippe_Nicod's avatar
      Philippe_Nicod
      Copper Contributor

      Dear OliverScheurichmany many thanks for your very quick solution 🙂 it is working perfectly and spares me many hours searching for the right formula (I wouldn't have found this though). You made my day ! Thanks

      Philippe

Resources