+ Reply to Thread
Results 1 to 3 of 3

Odd Behaviour - Can't match.. 2 cells equal, not exact? why?

  1. #1
    Registered User
    Join Date
    04-24-2008
    Posts
    85

    Odd Behaviour - Can't match.. 2 cells equal, not exact? why?

    Hello,
    I'm trying to compare two spreadsheets, the data I'm using is "equal" to each other, but is not exact... and I don't know how I could compare the two...

    When I try to vlookup and use exact (when it's not exact - data not reliable) I get no results returned.

    When I try index/match, I get no results either.

    I've attached a spreadsheet which contains A1 and A2, each of these cells is from a different data source.

    If I overwrite A1 with the actual text I get a match... but I can't possibly do this to all of my data...

    Any suggestions on how I match these?

    I tried vlookup(trim(A1).. or left(A1... but any of these still dont give me an exact match..

    Any help would be appreciated.
    Thanks
    Attached Files Attached Files
    Last edited by AdamParker; 07-15-2011 at 12:25 PM. Reason: Solved

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Odd Behaviour - Can't match.. 2 cells equal, not exact? why?

    If you do a =CODE(LEFT(A1)) and copy down, you get 2 different codes for the left-most character.. so they are not exact... also noticed that the =CODE(RIGHT(A1)) is inconsistent for the 2....

    It revealed that the character code for A1 is 63... and the only way I was able to match them us to get TRUE was with formula:

    =EXACT(MID(A1,2,LEN(A1)-2),A2)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Odd Behaviour - Can't match.. 2 cells equal, not exact? why?

    Strangely, it looks like the data in A1 has both a leading blank spot and a trailing blank spot. This formula will show if they are exact, minus the blank spots:

    Please Login or Register  to view this content.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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