Compare Sentence to sentence in two sets of data

Copper Contributor

Hi I have two sets of details regarding a same item/product. Need to know how can I compare them sentence to sentence or word to word. 

 

Eg:
Column 1 : John is now 15 years old, i had met him few years back when he was a 5 year old. 

Column 2: Mark's son John is 15 years old, I had met him few years back when he was 5 a year old, today he has grown up into an all rounder.

 

I have such details for 1000 of rows; Need help in the following

1. How to match if C1 is sub set of C2 using string match or vice versa 

2. how to check % of matching of C1 on C2. 

3. Is it possible if there is/are unrelated words in between of a sentence and still can be matched? 

 

Your help is much appreciated. 

 

Thanks 

4 Replies

Hi @nitinprabhu 

 

That's not possible with native Excel

As Wyn has already said, Excel would not be the right tool for that. In fact, I can't think of any normal office software product, off the shelf, that could do that.
HOWEVER, if all of your entries contain similar kinds of entries (and if this is something you're going to be doing for the future)...I CAN conceive of using Excel if you were to re-think this as a database rather than simply a place to store casual notes.
IF, for example, you always record DATEFIRSTMET, BIRTHDAY (or some basic reference that would allow you to calculate age today or at other points in time), GRADDATE, etc., and, importantly, have standardized answers (a range of them could be created) for entries in such fields as PRETEEN PERS(onality), TEEN PERS(onality)...into which such descriptons as "rounder","shy","bookish" or whatever....

Do you get the idea? This sounds like you're a counselor in some setting....

I realize that all I'm doing is scratching the surface of how such a database could be created, and you'd always have to have a column or two to allow you to enter "non-standard" observations, or a note to self on "this is what we need to talk about next time we meet"....

What you have done so far, though, is to use Excel simply as a note taking device which happens to be in/on a computer; you've not used EXCEL for the purposes it actually serves. To do the latter, you need to re-think the way you keep those records.

@nitinprabhu 

 

I suddenly realised you may be able to do part of this using Excel Power Query

 

(if you have Excel 2016 or later this demo file should work)

 

Have you used Power Query before?

 

It only compares the number of words that match list 1, and doesn't look at order

 

image.png

 

 

@Wyn Hopkins Thank you for sharing "Sentence Comparer.xlsx" I found it very helpful. I noticed that when using it with my data of 1053 sentences it switches the order of comparisons leading to comparing sentences from different lines that usually results in 0 matches. 

Do you have any suggestions? 

 

Thank you

Aziz

 

Untitled.png