+ Reply to Thread
Results 1 to 4 of 4

Row compare

  1. #1
    Forum Contributor
    Join Date
    07-16-2007
    Posts
    131

    Row compare

    Does anyone have a neat way to compare a row of data in one sheet to a row of data in another sheet? In other words, I have two sheets (A & B) with thousands of line of data in each. There are 24 columns (24) in each sheet and the column names are identical. I want to search every row in sheet A to find the row in sheet B where the values in each column are exactly the same.

    Thanks.

  2. #2
    @dministrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    33,279

    Re: Row compare

    1) You can concatenate the values together for each row using a formula...

    =A2&"-"&B2&"-"&C2&"-"&D2&"-"&E2&"-"&F2&"-"&G2&"-"&H2&"-"&I2&"-"&J2&"-"&K2&"-"&L2&"-"&M2&"-"&N2&"-"&O2&"-"&P2&"-"&Q2&"-"&R2&"-"&S2&"-"&T2&"-"&U2&"-"&V2&"-"&W2&"-"&X2

    2) Now copy that cell down the whole data set.

    3) Repeat that on the second sheet.

    Now you have an easy index you can search and "match" to. Assuming you did that in column Y of each sheet

    4) On sheet2 in column Z put this match formula: =MATCH(Y2, Sheet1!Y:Y, 0)

    5) Copy that down the column.

    You now have list of row numbers where the matches occured, or #N/A if not applicable (not found).

    6) Repeat with other sheet.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    07-16-2007
    Posts
    131

    Re: Row compare

    Thanks. I thought of doing that. I was hoping there was some kind of 'add' function where I would just add the binary values of each column; something like a checksum.

  4. #4
    @dministrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    33,279

    Re: Row compare

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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