Is it possible to 'auto-delete' rows of data held in one Excel 2010 file from another Excel file

Posted on 2011-10-21
Last Modified: 2012-05-12
I have a master Excel 2010 file of about 10,000 contact names and addresses (each contact on a row) and another Excel 2010 file of about 500 contact names which I need to delete from the master file. The rows in each file contain the same information (Email & Name).
Is there a way that I can use a formula or something to delete the 500 rows from the master list without doing it manually one-by-one?
Some kind of formula which says look for this contact in this file and delete?
I'm not an expert on Excel but maybe someone can help or come up with a solution!
Question by:awmorseuk
    1 Comment
    LVL 4

    Accepted Solution

    Like many things in Excel, there are multiple ways to do this, especially if there is a column or set of columns that uniquely identifies each row.  (Maybe you have more than one "John Johnson", but most likely, they aren't at the same address.)  Also, the approach depends on an exact entry for a duplicate item in each list.  (For example, if name and address will uniquely identify a row, then you can't have "123 Main Street" in one list and that be entered as "123 Main St." in the other)

    If you've got one unique column, then you don't have to build a temporary key, otherwise, construct a key with something like =CONCATENATE(trim(A1),"*",trim(b1)).  This formula assumes that you need two columns (A and B) to build a unique key.  You can use different columns, of course, vs. A and B, and you can add more than two columns, if needed.

    Once you have a unique identified for each row, you can use the column with the key (or constructed key if it takes more than one column as shown in the prior paragraph) and search the master list for entries that are listed in the list of 500.  How?  By using the MATCH function.  On your master list, in an adjacent, blank column to the right of your master data, you would enter something like: =IF(ISERROR(MATCH(Cell_With_Unique_Row_Key,Range_Of_Unique_Keys_In_500_List,0)),"","X").

    The last step is simply to filter your master list on the column with the IF/ISERROR/MATCH formula for cells with an "X".  Once filtered, you can delete all those rows.

    Hope this helps.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
    This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
    The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    26 Experts available now in Live!

    Get 1:1 Help Now