I would like a macro or VBA function to calculate a percentage match between two strings. Here are some examples:
String1: "A. Schulman"
String2: "A Schulman Co"
These strings have 11 characters in order that match, so the percentage match would be 11/12 or 92%
String2: "I B M"
3 characters match in sequence, out of 3 characters in string 1, so this would be a 100% match.
String1: "Ask MrExcel Consulting"
String2: "MrExcel.com Consulting"
These strings have 18 characters in order in common
so the percentage match would be 18/22 or 81%.
It is incredibly easy for our brain to look at these strings and pick out the common letters. Getting a VBA program to do the same seems incredibly hard.
I've tried to find an existing macro that will do this, but have not had any luck. If there is one publicly available and someone can point to it, that would be great.
If not, and if anyone can offer building blocks that lead to a solution, this would be greatly appreciated. I'll start at 200 points, even though I think the level of difficulty is way beyond that.
Thanks in advance for any ideas you might have.