• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Word string match formula

dmehta

New Member
Hey,

I am looking for a formula, that will match text string in two columns, but shall ignore word order.

Example:

Column A Column B
women shoes shoes women

This shall show as match "yes".

Can anybody help?

Thanks!!!
 
Hi, dmehta!
Welcome to Chandoo forums!
About your question, I can't think of a way of doing it with formulas using standard functions. If you're willing to use macros then a solution may be building a UDF (user defined function) and then using it in a formula.
Regards!
 
If you're talking about just looking at two cells, this will work:

=IFERROR(IF(AND(FIND("shoe",A1)>0,FIND("shoe",B1)>0),"yes",""),"no")
 
Hey all,

Thank you!

@azumi, thank you the second row should have shown "no" because "Aplle" isn't in there.

But appreciate it!
 
Hi ,

If each column can contain at most two words separated by a space , try this formula :

=IFERROR(IF(SEARCH(A2, B2 & " " & B2), "Yes"), "No")

Narayan
 
One more approach based on layout posted by azumi. In cell C2 normally enter following formula and copy down:

=IFERROR(FREQUENCY(-ISNUMBER(SEARCH(TRIM(MID(SUBSTITUTE(" "&B2," ",REPT(" ",99)),ROW($A$1:INDEX(A:A,LEN(B2)-LEN(SUBSTITUTE(B2," ",""))+1))*99,99)),A2)),{-1})/(LEN(B2)-LEN(SUBSTITUTE(B2," ",""))+1),0)

Format cell as %age which will indicate %age word match with the other cell. Current formula will tell %age match of col B with col A. You just need to reverse the logic if you want to compare opposite.
 
Back
Top