Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Routine to find exact Row matches in Col1 Col2 Col3 but exact offsetting numbers in Col4 [email protected] Excel Discussion (Misc queries) 0 June 11th 08 11:30 PM
comparison similar rows in Excel mareks1234 Excel Discussion (Misc queries) 9 April 25th 07 09:48 PM
EXACT comparison formula [email protected] Excel Worksheet Functions 3 September 1st 05 04:29 PM
similar vs. exact comparison dave in Toronto Excel Discussion (Misc queries) 1 August 31st 05 10:36 PM
MATCH function - 2 columns w/ SIMILAR, not EXACT data Jane Excel Worksheet Functions 3 March 5th 05 03:11 AM


All times are GMT +1. The time now is 04:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"