Skip to main content

How to exclude values in one list from another in Excel?

Supposing you have two data lists as the left screenshot shown. Now you need to remove or exclude names in column A if the name existing in column D. How to achieve it? And what if the two lists locate in two different worksheets? This article provides two methods for you.

Exclude values in one list from another with formula

Quickly exclude values in one list from another with Kutools for Excel


Exclude values in one list from another with formula

You can apply the following formulas to achieve it. Please do as follows.

1. Select a blank cell which is adjacent to the first cell of the list you want to remove, then enter formula =COUNTIF($D$2:$D$6,A2) into the Formula Bar, and then press the Enter key. See screenshot:

Note: In the formula, $D$2:$D$6 is the list you will delete values based on, A2 is the first cell of the list you are going to remove. Please change them as you need.

2. Keep selecting the result cell, drag the Fill Handle down until it reaching the last cell of the list. See screenshot:

3. Keep selecting the result list, then click Data > Sort A to Z.

Then you can see the list is sorted as below screenshot shown.

4. Now select the entire rows of names with result 1, right click the selected range and click Delete to remove them.

Now you have excluded values in one list based on another.

Note: If the “to-remove-list” locating in range A2:A6 of another worksheet such Sheet2, please apply this formula =IF(ISERROR(VLOOKUP(A2,Sheet2! $A$2:$A$6,1,FALSE)),"Keep","Delete") to get all Keep and Delete results, go ahead to sort the result list from Ato Z, and then manually delete all name rows contains the Delete result in current worksheet.


Quickly exclude values in one list from another with Kutools for Excel

This section will recommend the Select Same & Different Cells utility of Kutools for Excel to solve this problem. Please do as follows.

Before applying Kutools for Excel, please download and install it firstly.

1. Click Kutools > Select > Select Same & Different Cells. See screenshot:

2. In the Select Same & Different Cells dialog box, you need to:

  • 2.1 Select the list you will remove values from in the Find values in box;
  • 2.2 Select the list you will delete values based on in the According to box;
  • 2.3 select the Single cell option in the Based on section;
  • 2.4 Click the OK button. See screenshot:

3. Then a dialog box pops up to tell you how many cells have been selected, please click the OK button.

4. Now values in column A are selected if there are existing in column D. You can press the Delete key to delete them manually.

  If you want to have a free trial (30-day) of this utility, please click to download it, and then go to apply the operation according above steps.


Quickly exclude values in one list from another with Kutools for Excel


Related articles:

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
"foruma contains an error!"
Wondeful help...
This comment was minimized by the moderator on the site
the function is correct: maybe you have Excel in a different language than english. Change the function names in that way. :)
This comment was minimized by the moderator on the site
Thank you for this. It solved my problem of wanting to include only companies from a list
This comment was minimized by the moderator on the site
This formula subtracts list in column B from list in columnA:=FILTER(IFNA(MATCH(A2:A12,B2:B6,0),A2:A12),ISNUMBER(IFNA(MATCH(A2:A12,B2:B6,0),A2:A12))=FALSE)
This comment was minimized by the moderator on the site
But this one's simpler (Subtracts list in A2:A20 from list in D2:D6):=FILTER(A2:A20,ISERROR(MATCH(A2:A20,D2:D6,0))=TRUE)
This comment was minimized by the moderator on the site
Keith,

This formula was incredibly helpful (even more helpful than the actual blog post!) You're a life saver! This formula gets really powerful if you use it in dynamic arrays.
This comment was minimized by the moderator on the site
what if I have multiple columns?
This comment was minimized by the moderator on the site
Depends on the structure of your lists, but if you want to exclude several lists Y and Z from a single big list X, try something like this:
=FILTER(X3:X21,ISERROR(MATCH(X3:X21,Y3:Y6,0))*ISERROR(MATCH(X3:X21,Z3:Z5,0))=1)
this returns listX minus listY and listZ.
The "ISERROR(MATCH(X3:X21,Y3:Y6,0))" returns "TRUE" if an item in listX is missing from listY, likewise ISERROR(MATCH(X3:X21,Z3:Z5,0)) for listX and listZ.
A quirk of Excel is that "=TRUE*TRUE" will return "1". In fact, any number of TRUEs multiplied will return "1", but include a single FALSE and it will return "0".
So the FILTER will return only those items from the list where all the "ISERROR(MATCH....." formulae are TRUE.
For each additional list of items to exclude, add an extra *ISERROR(MATCH(listX,list_exclude,0)) before the "=1)"
This comment was minimized by the moderator on the site
You could try a filter of a filter:=FILTER(A2:A20,ISERROR(MATCH(A2:A20,FILTER(Array2,Include_criteria2)))=TRUE)
This comment was minimized by the moderator on the site
Apologies, that should read "Subtracts list in D2:D6 from list in A2:A20."
This comment was minimized by the moderator on the site
Apologies, that should read "Subtracts list in D2:D6 from list in A2:A20."
This comment was minimized by the moderator on the site
Apologies, that should read "Subtracts list in D2:D6 from list in A2:A20"
This comment was minimized by the moderator on the site
Good find. Thank you for this clever workaround. I thought was only possible via macros.
Possible to do the same using method 1, for a range consisting in two columns. i.e City, State in col D2:E20 while my A2:C1000 (B:C has city,state) has the set I need to get marked?
tried this did not work: =COUNTIF($D$2:$E$20,B2:C2). Unless you have another wonderful guide.
This comment was minimized by the moderator on the site
Как безграмотный человек писал эту статью? Тот, кто русский язык не учил, ни одной книги не прочел и не общался в социуме никогда? Уже с самого начала статьи обороты почти в каждом предложении такие, что на голову не натянешь. Зачем писать, если не умеешь писать?
This comment was minimized by the moderator on the site
I receive other values in the COUNTIF column like 2 but also higher numbers other than 0 and 1. What does that mean?
This comment was minimized by the moderator on the site
The values you get in the COUNTIF column are equal to the number of occurrences of the element in the right column. For example, if you have 5 displayed against a cell in the Name column, it means that this name was found in the To-remove-list not one, but five times.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations