• 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.

How can I count the number of common words between two different cells/strings?

nevarine

New Member
Hey Excel ninjas,

I need to calculate the number of common words between two cells.

For example:
A1: The quick brown fox jumps over the lazy dog
A2: The dog jumps under the fox

In this case, the formula would return 5, as there are5 common words.

If possible, I'd like to not use any helper cells/VBA.

Thanks!
 
Try,

In B2, enter CSE formula (confirmed enter with Ctrl+Shift+Enter) :

=COUNTA(FILTERXML("<a><b>"&SUBSTITUTE(A2&" "&A3," ","</b><b>")&"</b></a>","//b[preceding::* =.][not(following::* =.)]"))

77298
 
Back
Top