+ Reply to Thread
Results 1 to 4 of 4

Row compare

  1. #1
    Forum Contributor
    Join Date
    07-16-2007
    MS-Off Ver
    Excel 2003 and Excel 2016
    Posts
    178

    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
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    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
    MS-Off Ver
    Excel 2003 and Excel 2016
    Posts
    178

    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
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    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)

Similar Threads

  1. Replies: 6
    Last Post: 05-30-2012, 03:09 PM
  2. Compare & ... with VBA.
    By omnibuster in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2007, 02:33 PM
  3. Compare
    By graeme86 in forum Excel General
    Replies: 3
    Last Post: 05-23-2007, 09:00 AM
  4. [SOLVED] How do I compare cells and if FALSE compare to next cell in EXCEL
    By Cindie in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-24-2006, 01:35 PM
  5. String compare doesn't compare?
    By Ken Soenen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2006, 11:45 AM

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