+ Reply to Thread
Results 1 to 7 of 7

Formula to search for matches, duplicates and new values between 2 columns

  1. #1
    Registered User
    Join Date
    05-02-2016
    Location
    New Zealand
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    21

    Formula to search for matches, duplicates and new values between 2 columns

    Hi all,

    I'm trying to figure out a good, efficient formula (for 50,000 entries) that can check a list (range) of values in an unsorted column against another unsorted column to confirm if there's a match or not. The result would then be shown in a 3rd column.

    - If a value shows up in New Assets but not Old Assets, return the value "New"
    - If a value shows up in Old Assets but not New Assets, return the value "Replaced"
    - If a value is duplicated within the New Assets column, return "Duplicate New"
    - If a value is duplicated within the Old Assets column, return "Duplicate Old"

    In addition, there's a difference between the total number of assets in one column compared to the other. How best should this be handled?

    I have attached a sample spreadsheet. Many thanks for any assistance in advance.

    Cheers, randomkiwi
    Attached Files Attached Files

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Formula to search for matches, duplicates and new values between 2 columns

    try this in C2 and drag down. Not sure I understand duplicate new and duplicate old. I looked for more than one occurrence of that asset in the new and old column respectively
    Please Login or Register  to view this content.
    Suggest you check a few to make sure I understood correctly
    Happy with my advice? Click on the * reputation button below

  3. #3
    Registered User
    Join Date
    05-02-2016
    Location
    New Zealand
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    21

    Re: Formula to search for matches, duplicates and new values between 2 columns

    Cheers for the help. I've tried the formula and it does return new assets and replaced assets - many thanks. The only issue I have is that it takes 10 mins to process with 50000 entries - wondering if there might be a quicker way or if this would be the best formula considering the type of search being conducted?

    I thought it might even be best to split the formula - checking for "replaced assets" against the old assets list and new assets against the new assets list, so that the asset number can be matched against the status of the asset. This would mean that 2 extra columns would be added. Sorry if this doesn't make sense - I can come back later with more details if required.

  4. #4
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Formula to search for matches, duplicates and new values between 2 columns

    Quote Originally Posted by randomkiwi View Post
    I've tried the formula and it does return new assets and replaced assets
    .
    Did the other categories work too? They all worked on my example.

    As far as speed is concerned I have no idea if its quicker if you split. I suspect not but give it a go. Just put each part of the formula in a different column.

    10minutes is still OK for 50,000 entries I would have thought. Make a cup of coffee while it runs

  5. #5
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Formula to search for matches, duplicates and new values between 2 columns

    Try this instead and see if it's quicker

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,180

    Re: Formula to search for matches, duplicates and new values between 2 columns

    Try

    =IF(OR(A2="",B2=""),"",IF(COUNTIF(A:A,B2)=0,"New",IF(COUNTIF(B:B,A2)=0,"Replaced",IF(COUNTIF(B:B,B2)>1,"Duplicate New",IF(COUNTIF(A:A,A2)>1,"Duplicate Old","")))))

  7. #7
    Registered User
    Join Date
    05-02-2016
    Location
    New Zealand
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    21

    Re: Formula to search for matches, duplicates and new values between 2 columns

    Thanks for the help guys - all these formulas are great! I understand this is a large amount of data, so a quick formula is not really possible - but a few minutes wait is not that bad either considering the number of entries. Thanks again for the assistance

+ 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. [SOLVED] 2 matches, search and return column values
    By madnezzsg in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-23-2015, 04:10 PM
  2. [SOLVED] search for specific data in two columns and if it matches returns an ID number
    By ncaravela in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-24-2013, 01:48 PM
  3. [SOLVED] Need to search 2 columns at once - and report the results where matches are found
    By mrs_doubtfire in forum Excel Formulas & Functions
    Replies: 26
    Last Post: 10-16-2013, 03:40 PM
  4. Replies: 1
    Last Post: 09-26-2013, 12:16 PM
  5. Search two columns for identical matches on button press macro
    By RainbowLettering in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-03-2013, 03:03 PM
  6. Replies: 0
    Last Post: 08-11-2012, 03:25 PM
  7. Search (match) through columns and find ALL matches
    By qz33 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-11-2008, 08:58 PM

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