+ Reply to Thread
Results 1 to 7 of 7

Comparing 2 Spreadsheets to Identify duplicate rows

  1. #1
    Registered User
    Join Date
    03-28-2012
    Location
    Missouri
    MS-Off Ver
    Excel 2007
    Posts
    30

    Comparing 2 Spreadsheets to Identify duplicate rows

    I know that this has been discussed at some point but for the life of me I cannot find a solution to my issue. If someone could help me with this I would appreciated it.

    I have 2 spreadsheets in 1 workbook. One tab is named MASTER and the other tab is named WORKSHEET. Both spreadsheets are identically setup with 3 columns titled UPC, Stockcode, Division. What I want to do is match the rows on the worksheet spreadsheet to the master spreadsheet.

    The formula or macro needs to take the first row in the worksheet spreadsheet and then look for a match in the master spreadsheet, all 3 columns of data must match exactly when compared to each spreadsheet.

    Example

    MASTER
    UPC STOCKCODE DIVISION
    1234567890 123456 KANSAS CITY
    2222222222 323232 FORT WORTH
    3333333333 414141 OKLAHOMA

    WORKSHEET
    UPC STOCKCODE DIVISION
    1234567890 123456 MEMPHIS
    2222222222 323232 FORT WORTH
    3333333333 414141 NASHVILLE

    Note: In this example there is only one true match where all 3 columns are in the same row.

    Basically all I want done is to have the matched rows highlighted or identified in some way on the "WORKSHEET", so as too make them easily identifiable.

    Hope that makes sense.

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

    Re: Comparing 2 Spreadsheets to Identify duplicate rows

    Since you are using Excel 2003, as per your profile... i would suggest that you first make a helper column on each sheet, concatenating the 3 columns together.

    e.g. =A1&"_"&B2&"_"&C2 (the underscore is to ensure the fields are separated correctly).

    Then you can use a formula like:

    =Isnumber(Match(D2,Sheet2!D:D,0))

    copied down where column D is your helper in both sheets.

    TRUE means match found.
    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
    Registered User
    Join Date
    03-28-2012
    Location
    Missouri
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Comparing 2 Spreadsheets to Identify duplicate rows

    I see what you are getting at, but my columns contain text and numeric values, so that approach will not work.

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

    Re: Comparing 2 Spreadsheets to Identify duplicate rows

    It should still work... Isnumber() is not checking for numeric.. it is checking if MATCH() returned a numeric result (meaning match found at a certain position). Give it a try.

  5. #5
    Registered User
    Join Date
    03-28-2012
    Location
    Missouri
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Comparing 2 Spreadsheets to Identify duplicate rows

    That worked. I appreciate the help!

  6. #6
    Registered User
    Join Date
    04-08-2013
    Location
    Us
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Comparing 2 Spreadsheets to Identify duplicate rows

    Quote Originally Posted by eagle670 View Post
    That worked. I appreciate the help!
    While this may work, I am using excel 2010; How would you perform this same exact function in 2010.

    I am only asking because it was noted when answer was provided.

    Thank you in advance.

    Edit : Also, wouldn't be that be A2 in the formula?
    Last edited by Doubolplay1; 04-08-2013 at 11:19 PM.

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

    Re: Comparing 2 Spreadsheets to Identify duplicate rows

    You are correct that should have been =A2&"_"&B2&"_"&C2

    you can use the same in 2010, but you can also use COUNTIFS without helper column.

    e.g. =COUNTIFS(Sheet2!A:A,A2,Sheet2!B:B,B2,Sheet2!C:C,C2)>0 copied down.

+ 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