+ Reply to Thread
Results 1 to 24 of 24

Is It Possible to cross match duplicates in 2 different workbooks with a formula?

  1. #1
    Registered User
    Join Date
    03-04-2013
    Location
    Market Rasen, England
    MS-Off Ver
    Excel 2019
    Posts
    62

    Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    I have 2 workbooks with various matching data and i would like this to be indicated with "yes" or a "no" in a seperate column in the 2nd workbook, is this possible?

    In workbook 1 i have the date in column A and a name in column C, in workbook 2 i have the date in column C and a name in column L, can anyone help me with a formula to check if any of the data in column A and Column C of workbook 1 is the same as column C and Column L in workbook 2?

    Any help is much appreciated

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    yes, are they likely to be duplicates of the data throughout the lists - or will the combination of column A and C be unique ?

    perhaps a sample spreadsheets with some dummy data

  3. #3
    Registered User
    Join Date
    03-04-2013
    Location
    Market Rasen, England
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    Thanks for your quick reply, both workbooks have numerous rows of data for every date from August 1st 2012 to present date and i would like to know which dates/names are the same in both workbooks

  4. #4
    Registered User
    Join Date
    03-04-2013
    Location
    Market Rasen, England
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    attach files in 1 workbook

    Dummy Book1.xlsx

  5. #5
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    this should work
    Both workbooks need to be open

    =IF(ISERROR(MATCH(C2&L2,'[c-book1.xlsx]Sheet1'!$A$1:$A$24&'[c-book1.xlsx]Sheet1'!$C$1:$C$24,0)),"No","Yes")

    needs to be entered as an array formula - use - control+shift+enter keys

    if you need to refer to a different directory on the PC
    'c:\folder\[c-book1.xlsx]Sheet1'!$A$1:$A$24

    see attached spreadsheets

    note c-book2 column P has the code
    Attached Files Attached Files

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    crossed post
    so i have updated your spreadsheet - i thought you meant two different workbooks not sheets

    so modification to formula
    =IF(ISERROR(MATCH(C2&L2,Sheet1!$A$1:$A$1700&Sheet1!$C$1:$C$1700,0)),"No","Yes")
    enter as array so you get {} around formula
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-04-2013
    Location
    Market Rasen, England
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    Sorry for the confusion i put them in 1 workbook so you had an idea of what i wanted, but it is 2 different workbooks as per your first formula

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    cool :up: let me know if it does not work - please check carefully it is working correctly

  9. #9
    Registered User
    Join Date
    03-04-2013
    Location
    Market Rasen, England
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    Sorry etaf i've not explained this well at all, each workbook has a differing amount of rows entered for each date so workbook 1 has 1040 rows and workbook 2 has 2641 rows so the matching data will be in different rows eg. 22/02 danziger is in row 984 in workbook 1 but its in row 2553 in workbook 2, but its a match. Is it possible to add a formula that will find these?

  10. #10
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    that should not matter
    in work book 2 - its comparing all rows in workbook 1
    so the code in workbook 2 when the formula is copied down all the rows to 2641 - @row 2553 in workbook2
    =IF(ISERROR(MATCH(C2553&L2553,Sheet1!$A$1:$A$1700&Sheet1!$C$1:$C$1700,0)),"No","Yes")
    the issue maybe the range here for workbook1
    Sheet1!$A$1:$A$1700&Sheet1!$C$1:$C$1700
    but should be covered as it goes up to 1700 and you only have 1040 rows

    does that make sense ?

    your single book example did not go upto row 2553

    prince tom is in row 19 sheet1 and also in row 39 sheet 2 and is picked up as Yes (dates the same)
    Last edited by etaf; 03-04-2013 at 06:07 PM.

  11. #11
    Registered User
    Join Date
    03-04-2013
    Location
    Market Rasen, England
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    Yes that makes perfect sense, both workbooks are named and have multiple named sheets, do i need to change "sheet1" in the formula to the sheet names that i want checking or just have them open on the correct pages when entering the formula?

  12. #12
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    do i need to change "sheet1" in the formula to the sheet names that i want checking
    yes the range , the sheet name, the filename and file path all need to be correct for your environment

    =IF(ISERROR(MATCH(C2&L2,'[c-book1.xlsx]Sheet1'!$A$1:$A$24&'[c-book1.xlsx]Sheet1'!$C$1:$C$24,0)),"No","Yes")

    if the works books are in the same folder the above will work
    otherwise you also need the full path to the folder they are in

    'c:\users\username\documents\folder\[workbookname.ext]sheetname'!rangeofcells

    just have them open on the correct pages when entering the formula?
    No , the names need to be correct
    and both the workbooks need to be open , excel wont look inside a closed workbook without a special function (which I have not been able to work on 2010) on other questions here for some reason.

    whats the full path and sheet names of the workbooks you have ?

  13. #13
    Registered User
    Join Date
    03-04-2013
    Location
    Market Rasen, England
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    Thanks for your time etaf, the wokbook paths are:

    C:\Users\PINGU\Dropbox\Racing\RTR FRAC LAYS.xlsx]All (workbbook 1)
    C:\Users\PINGU\Dropbox\Bst\NARROW LAYS.xlsm]N Lays (workbook 2)

  14. #14
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    'c:\users\username\documents\folder\[workbookname.ext]sheetname'!rangeofcells

    'C:\Users\PINGU\Dropbox\Racing\[RTR FRAC LAYS.xlsx]
    is the sheetname All (workbbook 1)
    and whats the range name

  15. #15
    Registered User
    Join Date
    03-04-2013
    Location
    Market Rasen, England
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    workbook 1 sheet name is All
    workbook 2 sheet name is N Lays

    Sorry etaf i don't know what a range name is, could you explain please?
    Last edited by Ramenmole; 03-05-2013 at 11:17 AM.

  16. #16
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    the range of cells you want to look up
    1040 rows and workbook 2 has 2641 rows
    what columns - A & C and C&L still
    C:\Users\PINGU\Dropbox\Racing\RTR FRAC LAYS.xlsx]All

    =IF(ISERROR(MATCH(C2&L2,'C:\Users\PINGU\Dropbox\Racing\[RTR FRAC LAYS.xlsx]All'!$A$1:$A$1100&'C:\Users\PINGU\Dropbox\Racing\[RTR FRAC LAYS.xlsx]All'!$C$1:$C$1100,0)),"No","Yes")

    into workbook 2 sheet name is N Lays whatever column you want to return the result into - first row and copy down to row 2641

  17. #17
    Registered User
    Join Date
    03-04-2013
    Location
    Market Rasen, England
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    Now that's looking promising, i now have a mixture of "yes" and "no" down the column up to row 2425 in workbook 2 which is the last "yes", from then on its all "no" but i have manually matched some rows below this but the formula has entered "no". I have checked the spelling and date and they both are correct and are a match, any idea what may be causing this?

  18. #18
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    whats after row 2425 in workbook 2 , in column c and l - thats the matching

  19. #19
    Registered User
    Join Date
    03-04-2013
    Location
    Market Rasen, England
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    row 2553 matches with 984 in book 1
    2554 matches with 985
    2590 matches with 1024
    2595 matches with 1029
    2596 matches with 1030
    2598 matches with 1034

  20. #20
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    it should still match if exactly the same
    I did not use trim() - so it maybe there is a space after the name - that will not match

    can we see those entries at all ?

    if you click on the name in 2554 and then click in the formula bar - does the curser stop on the name or is there a space between the name and curser
    same for row 985

  21. #21
    Registered User
    Join Date
    03-04-2013
    Location
    Market Rasen, England
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    There's a space in all the errors which i've now deleted and the formula changed to "yes", so i guess i need trim adding to the formula to make sure no other matches are missed?

  22. #22
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    yes ,

    so for the name cells which is C and L - use
    TRIM( )

    =IF(ISERROR(MATCH(C2&TRIM(L2),'C:\Users\PINGU\Dropbox\Racing\[RTR FRAC LAYS.xlsx]All'!$A$1:$A$1100&TRIM('C:\Users\PINGU\Dropbox\Racing\[RTR FRAC LAYS.xlsx]All'!$C$1:$C$1100),0)),"No","Yes")
    should work

    dont forget when you edit to add the control+shift+enter to get an array {}

  23. #23
    Registered User
    Join Date
    03-04-2013
    Location
    Market Rasen, England
    MS-Off Ver
    Excel 2019
    Posts
    62

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    That's done the job, thanks a lot you have saved me from hours of manual checking

  24. #24
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Is It Possible to cross match duplicates in 2 different workbooks with a formula?

    your welcome :up:

+ 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