+ Reply to Thread
Results 1 to 4 of 4

Similar vs. Exact comparison

Hybrid View

  1. #1
    dave in Toronto
    Guest

    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. #2
    Chip Pearson
    Guest

    Re: 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" <daveinToronto@discussions.microsoft.com> wrote
    in message
    news:78CAA296-11C0-4714-893E-0103205AA60E@microsoft.com...
    > 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. #3
    Tom Ogilvy
    Guest

    Re: 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" <daveinToronto@discussions.microsoft.com> wrote in message
    news:78CAA296-11C0-4714-893E-0103205AA60E@microsoft.com...
    > 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. #4
    John Keith
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1