Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Similar vs. Exact comparison
I'd like to compare two cells (or more possibly) for similarity vs. exact.
e.g. a cell with the i.d. of 'johnsmith' is not exactly equal to 'johnsmith2'. Is there a way in excel to compare two cells and see if they are similar? Maybe even some kind of confidence level flag? (or is this a fantasy?) thanks, dave |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Similar vs. Exact comparison
You can use the Like operator with a wildcard character. E.g.,
Dim S As String Dim T As String S = "johnsmith" T = "johnsmith1" Debug.Print T Like "*" & S & "*" -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "dave in Toronto" wrote in message ... I'd like to compare two cells (or more possibly) for similarity vs. exact. e.g. a cell with the i.d. of 'johnsmith' is not exactly equal to 'johnsmith2'. Is there a way in excel to compare two cells and see if they are similar? Maybe even some kind of confidence level flag? (or is this a fantasy?) thanks, dave |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Similar vs. Exact comparison
Nothing built in like Soundex
http://www.j-walk.com/ss/excel/tips/tip77.htm John Walkenbach's page with sample VBA code. but you can use wildcards with some functions Excel does have the EXACT function which will test for an exact match. -- Regards, Tom Ogilvy "dave in Toronto" wrote in message ... I'd like to compare two cells (or more possibly) for similarity vs. exact. e.g. a cell with the i.d. of 'johnsmith' is not exactly equal to 'johnsmith2'. Is there a way in excel to compare two cells and see if they are similar? Maybe even some kind of confidence level flag? (or is this a fantasy?) thanks, dave |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Similar vs. Exact comparison
If the "like" comparison isnt enough,
Here is a link to a page that has a VB function to calculate the similarity between two strings. This is a way to determine how closely matched any two strings are. It works be determining the number of incremental edits required to transform the first string into the second string. http://www.merriampark.com/ld.htm -- Regards, John "dave in Toronto" wrote: I'd like to compare two cells (or more possibly) for similarity vs. exact. e.g. a cell with the i.d. of 'johnsmith' is not exactly equal to 'johnsmith2'. Is there a way in excel to compare two cells and see if they are similar? Maybe even some kind of confidence level flag? (or is this a fantasy?) thanks, dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Routine to find exact Row matches in Col1 Col2 Col3 but exact offsetting numbers in Col4 | Excel Discussion (Misc queries) | |||
comparison similar rows in Excel | Excel Discussion (Misc queries) | |||
EXACT comparison formula | Excel Worksheet Functions | |||
similar vs. exact comparison | Excel Discussion (Misc queries) | |||
MATCH function - 2 columns w/ SIMILAR, not EXACT data | Excel Worksheet Functions |