+ Reply to Thread
Results 1 to 14 of 14

Formula? To match account names in seperate sheets - Containing nearest match

  1. #1
    Registered User
    Join Date
    04-16-2015
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    26

    Formula? To match account names in seperate sheets - Containing nearest match

    I am looking for a formula that will help me match a long list of account names.

    Have 2 sheets from data from separate databases, containing Account names. I know there are matches in Accounts from our database, that do not appear in the 2nd database. Spot checking a few i noticed many are matched account but the spelling and/or wording is slightly different.
    - Using a VLookup "True" verdict is not sufficient to use
    - I tried using the "Exact" verdict, but this was not helpful either

    Any ideas for better find/match formulas to help minimize the manual checking for all 1200 rows of data.

    Thanks again
    RohanF

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    Please post a sample workbook with expected results.

    Use "Go advanced" and click on "Paper Clip" icon to upload file.

  3. #3
    Registered User
    Join Date
    04-16-2015
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    26

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    Here is the sample sheet

    In the Sheet 1 "check database" I need to find the associated name in the Sheet 2 "DATABASE1".

    - Find the Account name from Sheet 1 Column A in the DATABASE 1 sheet.
    - The lookup point for matching account name is in Column A of Sheet 2
    - If an account match is found I want to return the Account ID value in Column D.

    Any help would be appreciated
    Attached Files Attached Files
    Last edited by RohanF; 06-03-2015 at 08:55 AM.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    This has identified some matches so hopefully it goes some way to helping you.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-16-2015
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    26

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    Thanks John very helpful, as it returned some extra details.

    I would like to understand more about the INDEX/MATCH formula, as it is very helpful.

    Can the formula be extend to either exclude or search for a wildcard of the below, which are several ways to write the same thing; and is cause to a lot of unsuccessful matching.?
    - PTY LTD
    - PROPRIETARY LIMITED
    - PTY LIMITED
    - LIMITED

  6. #6
    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,939

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    Perhaps this will help with understanding how INDEX/MATCH works...

    INDEX() syntax is =index(criteria-to-find,row-to-search-in,column to search in)
    so something like =INDEX(A1:J10,3,5)
    will return the contents of E3 (row 3, column 5)
    Didnt even use MATCH, did we?

    Now, to find the "3" or the "5", we would use the MATCH function...
    MATCH syntax is...=match(criteria-to-find,column-to-search-in,0) 0 returns exact match
    =MATCH("cc",A1"A10,0)
    If "cc" is in A3, this will return 3
    (to find the column number, we use the same thing, just change the range=MATCH(criteria-to-find,row-to-search-in,0)
    =MATCH("zz",A1:J1,0)
    If "zz" is in E1, then this will return 5

    Put them all together and you have...
    =INDEX(A1:J10,MATCH("cc",A1:A10,0),MATCH("zz",A1:J10))
    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

  7. #7
    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,939

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    Can the formula be extend to either exclude or search for a wildcard of the below, which are several ways to write the same thing; and is cause to a lot of unsuccessful matching.?
    - PTY LTD
    - PROPRIETARY LIMITED
    - PTY LIMITED
    - LIMITED
    This could probably be done, but it would be a lot easier if converted the abreviations to full words. You could do this by using a helper column (I used F), put this in F2, copied down...
    =SUBSTITUTE(SUBSTITUTE(C2,"Pty","Proprietary"),"Ltd","Limited")

    You could then do the same with the "lookup" data, and then base the formula on those helper columns. The helpers can be hidden if needed

  8. #8
    Registered User
    Join Date
    04-16-2015
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    26

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    Thanks FD, very useful insight.

    Looping back to Johns formula, he did use MATCH within the syntax

    =IFERROR(INDEX(DATABASE1!D:D,MATCH("*"&LEFT($A2,10)&"*",DATABASE1!$C:$C,0)),"")

  9. #9
    Registered User
    Join Date
    04-16-2015
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    26

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    In regards to this formula
    =IFERROR(INDEX(DATABASE1!D:D,MATCH("*"&LEFT($A2,10)&"*",DATABASE1!$C:$C,0)),"")

    in the MATCH function what is true meaning for "*"&LEFT($A2,10). ??

    Does this infer wildcard find for the first 10 characters in Cell A2..

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    @RohanF


    I see the forum experts have been very helpful (as always) in addressing your query to me, Have you got the answers you require?

    John

  11. #11
    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,939

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    Not quite...
    "*"&LEFT($A2,10)
    the LEFT() part is pulling the 1st 10 characters from A2, then the wild card is applied to that, so...any number of characters to the left of the 1st 10 characters in A2

    If A2 contains abcdefghijklmnopq then left(a2,10) would return abcdefghij
    so "*"&left(a2,10) would then match these...
    123abcdefghij
    aaaabcdefghij

    then, adding the &"*" after that, means that "anything"&"abcdefghij"&"anything" will be a match

  12. #12
    Registered User
    Join Date
    04-16-2015
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    26

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    Hi John, yes helpful as always.

    In regards to the formula
    =IFERROR(INDEX(DATABASE1!D:D,MATCH("*"&LEFT($A2,10)&"*",DATABASE1!$C:$C,0)),"")

    in the MATCH function what is true meaning for "*"&LEFT($A2,10). ??

    Does this infer wildcard find for the first 10 characters in Cell A2..

    I am trying to edit this slightly to define more possibilities

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    LEFT finds the characters starting at the LEFT. The RIGHT function is its equivalent and the MID function allows the selection of characters anywhere in a string.

    In my formula it is looking for any 10 character match going effectively left to right in the text.

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Formula? To match account names in seperate sheets - Containing nearest match

    I should have added that I also tried a 20 character match which was much less successful: it therefore might be worth trying a 5 character match to unearth a few more "rogues".

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Check if the data match in two seperate sheets
    By arun.sj in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-09-2014, 09:17 AM
  2. Index Match Match Formula DOESN'T WORK WITH TABLES/TABLE NAMES ??
    By Underling in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-04-2014, 09:01 PM
  3. lookup or match - Return nearest match
    By devouk in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-05-2012, 06:11 AM
  4. [SOLVED] Match multiple cells in seperate sheets and then insert cell
    By Jostler18 in forum Excel General
    Replies: 2
    Last Post: 05-01-2012, 04:59 PM
  5. SUMIF & MATCH Functions on Seperate Sheets
    By intreec in forum Excel General
    Replies: 0
    Last Post: 02-01-2012, 07:02 PM

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