+ Reply to Thread
Results 1 to 10 of 10

count if match based on two criterias not working with text

  1. #1
    Registered User
    Join Date
    06-30-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    8

    count if match based on two criterias not working with text

    hi,

    i have a list in column "a and b" in sheet 1 and a list in sheet 2 column "a and b" as well, the rows range vary

    i would to get the data from sheet1 that is not in sheet 2 and copy it in to sheet 3

    Please see attached excel.

    I have not been able to find a match using vlookup, countif , productsum...see row A2 and B2 they have the same exact name and amount on both sheets

    The last thing I tried to do was a simple find and replace and I found out that the excel is not able any "text" matches.????


    thanks
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: count if match based on two criterias not working with text

    for some reason, the space between the names is different in sheet 1 compared to sheet 2. Sheet1 space is code 32, sheet2 space is 160

    on sheet2, use this formula, copied down, to changethe 160 "space" to a 32 "space"...
    =LEFT(A2,FIND(",",A2,1))&" "&RIGHT(A2,FIND(",",A2,1)+2)

    then use your vlookup to find what you need
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    06-30-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: count if match based on two criterias not working with text

    Never mind I figured out what was happening. Turns out the software from which I got the info for sheet 2 export from, claims to be an excel export however the file encoding tells a different story.

    It is unbelievable, just gimme me the file as it truly is! it is like the true file format should have been ".openoffice" and they just changed the file extension to ".xls" and claimed it was an excel export. yeah excel will open it but making it work with formulas is another story. for example the instead of space for space, the file uses "~" to delimit spaces...so if i compare anything with spaces I would not get the same result even though the "~" is not visible unless you open the file in a HEX editor.

    WOW!!!!!!!!!!!!!!!!!! So frustrating!!!!!!!!!!!!!! Wasted a whole day on this.............................


    Edit: thanks for your help FDibbins! I saw your reply after I posted.
    Last edited by elrophin; 06-30-2012 at 06:34 PM.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: count if match based on two criterias not working with text

    glad to help, at least you can use my formula to get both sets of data talking to each other if you need to

  5. #5
    Registered User
    Join Date
    06-30-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: count if match based on two criterias not working with text

    that is right, I will use it all the time as this is something I will have to do regularly.

    Thanks again

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: count if match based on two criterias not working with text

    Hi,

    Although the names look the same they aren't.
    Take the name Alan, Lucille. What appears to be a space character between the , and L is the character whose code is 32 on sheet 1 and code 160 on sheet 2.

    You need to get them changed. The easiest would be to revert to the data from whence you extracted these lists (perhaps a csv file extracted from some other software) and ensure they are consistent. If not you'll need to copy the character from a name on each sheet and use Find Replace on the whole column and replace the character with a space character.

    When you've done this you can then use
    =MATCH(A2,'sheet 2'!A:A,FALSE)
    in C2 on sheet1 copied down. Then filter on column C for #N/A and copy the filtered rows to a third sheet.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  7. #7
    Registered User
    Join Date
    06-30-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: count if match based on two criterias not working with text

    did you find out about that Sheet1 space is code 32, sheet2 space is 160 using a HEX editor or did you do it in excel?

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: count if match based on two criterias not working with text

    i used =exact() and narrowed it down to the space. then i used =code() to see what the code was for each space (all done in excel)

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: count if match based on two criterias not working with text

    In Excel with =Code(Mid(A2,6,1))

  10. #10
    Registered User
    Join Date
    06-30-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: count if match based on two criterias not working with text

    good to know. that would have saved me hours!

    Now I know thanks to you guys!

    Thanks
    Last edited by elrophin; 06-30-2012 at 06:31 PM.

+ 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