ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Subtracting one list from another list (https://www.excelbanter.com/excel-worksheet-functions/161919-subtracting-one-list-another-list.html)

Brian

Subtracting one list from another list
 
Howdy All,

Here is what I have.

Column A is a list of several thousand record numbers, Column B is a list of
several thousand record numbers.

What I want to do.

I want to remove all the numbers which exist in Column A from the list of
numbers in Column B.

Any ideas on how this is accomplished are greatly appreciated.

Thank you,
Brian



ExcelBanter AI

Answer: Subtracting one list from another list
 
Hi Brian,

You can easily accomplish this task by using the "Remove Duplicates" feature in Excel. Here are the steps:
  1. Select the entire Column A and Column B by clicking on the column headers.
  2. Click on the "Data" tab in the ribbon.
  3. Click on the "Remove Duplicates" button in the "Data Tools" group.
  4. In the "Remove Duplicates" dialog box, make sure that only Column B is selected and click "OK".
  5. Excel will remove all the duplicate values from Column B, including those that exist in Column A.

This will leave you with a list of record numbers in Column B that do not exist in Column A.

Duke Carey

Subtracting one list from another list
 
If this were in a database, you'd do a simple 'NOT IN' query. In Excel
you'll have to use a formula, say in col C, to determine if the col B value
is in col A, then filter on the values in col C

if your col A values run from row 1 to 5000, then in C1 use

=IF(ISERROR(MATCH(B1,$A$1:$A$5000,0)),B1,"")

Copy it down to the end of col B data, then filter for <"", copy the
results and paste as values in a new sheet

"Brian" wrote:

Howdy All,

Here is what I have.

Column A is a list of several thousand record numbers, Column B is a list of
several thousand record numbers.

What I want to do.

I want to remove all the numbers which exist in Column A from the list of
numbers in Column B.

Any ideas on how this is accomplished are greatly appreciated.

Thank you,
Brian




Brian

Subtracting one list from another list
 
Thanks Duke.


"Duke Carey" wrote in message
...
If this were in a database, you'd do a simple 'NOT IN' query. In Excel
you'll have to use a formula, say in col C, to determine if the col B
value
is in col A, then filter on the values in col C

if your col A values run from row 1 to 5000, then in C1 use

=IF(ISERROR(MATCH(B1,$A$1:$A$5000,0)),B1,"")

Copy it down to the end of col B data, then filter for <"", copy the
results and paste as values in a new sheet

"Brian" wrote:

Howdy All,

Here is what I have.

Column A is a list of several thousand record numbers, Column B is a list
of
several thousand record numbers.

What I want to do.

I want to remove all the numbers which exist in Column A from the list of
numbers in Column B.

Any ideas on how this is accomplished are greatly appreciated.

Thank you,
Brian







All times are GMT +1. The time now is 08:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com