+ Reply to Thread
Results 1 to 10 of 10

How can I find "matching" records and display data from those records

  1. #1
    Registered User
    Join Date
    03-22-2015
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    42

    How can I find "matching" records and display data from those records

    Hello

    I have a very large spreadsheet with ~ 10,000 rows.

    What I am trying to achieve is to identify any rows where the text in a specific column matches that same column in another row. I then need to be able to display some text from those matches.

    Essentially, what I'm looking to do is identify clusters of records. The spreadsheet will be updated with new records daily so I need to find a simple solution I can use everyday. I'm actually only interested in finding if any of the new records added daily, match any older records. An example, shortened table is below... I hope this makes sense.

    Column A Column B Column C Column D (output column)
    154 Brisbane OrangeRed 154 (Brisbane),1531 (Adelaide), 7898 (Darwin)
    2504 Sydney RedYellow 2504 (Sydney)
    5134 Melbourne BluePink 5134 (Melbourne)
    1531 Adelaide OrangeRed 154 (Brisbane), 7898 (Darwin), 1531 (Adelaide)
    8645 Perth GreenBlue 8645 (Perth)
    5484 Singapore BluePink 5484 (Singapore)
    7898 London OrangeRed 154 (Brisbane), 1531 (Adelaide)
    1235 Singapore YellowGreen 1235 (Singapore)

    I'm not sure of the best way to achieve this so any/all suggestions appreciated!
    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: How can I find "matching" records and display data from those records

    .
    Hopefully this will get it done for you :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-22-2015
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: How can I find "matching" records and display data from those records

    Thankyou for this code. It seems to be highlighting any rows that have a match somewhere else in the list. What I'm really looking for is a way to identify that if Row 5 and Row 16 have specific cells matching; then in another column at the end of the spreadsheet, it would display data aobut Row 5 and Row 16. Does that make sense?

    For example, Cell A is a list of reference numbers, Cell B is a list of locations, Cell C is a list of injury types. If Cell B and Cell C are duplicated anywhere else in the list, then I want to display the reference number. Does that make sense?

    Happy to provide some more example data.

    Thanks for your time.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: How can I find "matching" records and display data from those records

    Try
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-22-2015
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: How can I find "matching" records and display data from those records

    This is amazing!! Thankyou so much Can I ask one tiny thing? Can you explain which sections of the above code relate to each column? I need to use this same process in another spreadsheet which has extra columns. In the new spreadsheet the affected columns are A (same as before), Q (was Column B) and AY (was Column C).

    Once again, thanks for your help.

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: How can I find "matching" records and display data from those records

    Throughout the code the numbers refer to the Columnnumber so
    a(i,1) refers to column A, a(i,2) refers to column B and a(i,3) refers to column C.
    So substituting those numbers with the new columnnumbers should do the trick. Only condition is that there cannot be empty columns in between, else code will fail.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: How can I find "matching" records and display data from those records

    Since your data starts from A1, and C column is the unique key.
    1, 2, 3 represents column reference.

  8. #8
    Registered User
    Join Date
    03-22-2015
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: How can I find "matching" records and display data from those records

    Thankyou both so much. I can't explain how much time this will save me. Forever grateful!!

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: How can I find "matching" records and display data from those records

    You are welcome and thanks for the rep.

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

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: How can I find "matching" records and display data from those records

    Though my contribution wasn't that big (jindon did all the hard work ) you're welcome and thanks for rep+.

+ 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. Pulling records matching two criteria and inserting those records into an existing list
    By desertfx41 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2014, 02:00 PM
  2. Find/Match records, offset to row, enter "x"
    By Aaron092 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-24-2014, 05:10 AM
  3. [SOLVED] Copy Records where records = "a" at Column B - Syntax Error
    By nironto in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-11-2013, 08:04 AM
  4. Replies: 0
    Last Post: 03-10-2011, 05:26 PM
  5. Replies: 0
    Last Post: 06-07-2010, 05:07 AM
  6. Copy all records matching "Text" criteria to new worksheet
    By StephenS in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-15-2006, 02:50 AM
  7. Why does it say "Filter mode" instead of "X of Y records"?
    By lucky_jed in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-07-2005, 07:06 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