Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Rick
Gord On Thu, 19 May 2011 13:42:52 -0400, "Rick Rothstein" wrote: But you could try this UDF from Rick Rothstein. Function ExactWordInString(Text As String, Word As String) As Boolean ExactWordInString = " " & UCase(Text) & " " Like "*[!A-Z]" & _ UCase(Word) & "[!A-Z]*" End Function Company name in A1 Company name written differently in B1 but has common word with A1 i.e. Kellog's in A1 The Kellog's Company in B1 In C1 enter this............=ExactWordInString(B1,A1) Hey, you saved one of my UDFs... neat! In case you are interested, I developed an Excel formula equivalent to this UDF. For the cell contents as you have defined them above... =IF(ISNUMBER(SEARCH(A1,B1)),AND(NOT(ISNUMBER(FIND (UPPER(MID("="&B1&"=",SEARCH(A1,B1),1)),"ABCDEFGHI JKLMNOPQRSTUVWXYZ"))),NOT(ISNUMBER(FIND(UPPER(MID( "="&B1&"=",SEARCH(A1,B1)+LEN(A1)+1,1)),"ABCDEFGHIJ KLMNOPQRSTUVWXYZ"))))) I developed this formula in response to the following blog article (where where the use of the A2 and B2 cell contents were reversed from how you proposed them in your response here)... http://www.get-digital-help.com/2009...-vba-in-excel/ Rick Rothstein (MVP - Excel) |