How many words match between two sentences? I need an excel formula for that.

Chris Manning

New Member
Joined
Feb 3, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have two sentences. I need a formula determining how many words match between the two sentences?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Welcome to the MrExcel board!

  1. Can the sentences contain any punctuation?
  2. If a solution by macro is possible is that acceptable?
  3. Could we have 5 or 6 sample pairs of sentences (any sensitive data disguised or removed) with the expected results so that we can see the sort of variety that you might have? Preferably with XL2BB
 
Upvote 0
To answer…
1. Some of the sentences might have punctuation
2. I prefer to just use a formula not a macro
3. For example A1 has the sentence “today I ate green fish” and b1 has the sentence “ate fish”. I want a formula that returns “2” (since Both the words ”are” and the word “fish” match between the two sentences
 
Upvote 0
2. I prefer to just use a formula not a macro
I doubt that you will be able to achieve that, particularly given the answer to point 1.

3. For example A1 has the sentence “today I ate green fish” and b1 has the sentence “ate fish”.
That hardly addresses my request for 5 or 6 samples showing variety. It also seems to ignore the answer to point 1.

Example:
"I ate Tom's fish" and "Tom ate fish"
Do you count that as 2 match or 3?

So, to help anybody who might try to suggest a formula approach (or macro), could you re-address point 3?
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,858
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top