Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Compare two lists; return only unique records

There is data in Column 'A' (514 Records) that will also be in Column 'B'
(1600 Records), I want excel to compare ColA to ColB and remove from B the
duplicate information in A. The end result should Column B without the
duplicate records from A. How do I do this?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Compare two lists; return only unique records

Public Sub ProcessData()
Dim LastRow As Long
Dim rng As Range

With ActiveSheet

LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row
.Range("C1").Resize(LastRow).Formula =
"=IF(ISNUMBER(MATCH(B1,A:A,0)),1,"""")"
.Columns(3).Value = .Columns(3).Value
Set rng =
Range("C:C").SpecialCells(xlCellTypeConstants).Off set(0, -1)
rng.Delete Shift:=xlUp
.Columns(3).ClearContents
End With

End Sub



--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Lkyred19" wrote in message
...
There is data in Column 'A' (514 Records) that will also be in Column 'B'
(1600 Records), I want excel to compare ColA to ColB and remove from B the
duplicate information in A. The end result should Column B without the
duplicate records from A. How do I do this?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default Compare two lists; return only unique records

Hi,

Let's assume you are using Excel 2003 or earlier:

1. In cell C2 enter the formula COUNTIF(A$2:A$516,B2) copy it down the 1600
rows.
2. Choose Filter, Auto Filter
3. Open the auto filter on column C and choose Custom, Does not equal and
set the value to 0 (zero) This will hide all the rows that are not
duplicates.
4. Select the items in column B and press Delete (if you are using a
version before 2002 let us know). This will remove all the duplicates.
5. Turn off the filters.
6. Highlight column B and sort it. Clear column C.


--
Cheers,
Shane Devenshire


"Lkyred19" wrote:

There is data in Column 'A' (514 Records) that will also be in Column 'B'
(1600 Records), I want excel to compare ColA to ColB and remove from B the
duplicate information in A. The end result should Column B without the
duplicate records from A. How do I do this?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Compare two lists; return only unique records

Here is a useful link to one of my favorite web sites:
http://www.cpearson.com/excel/Duplicates.aspx

If you have a chance, check this out too...
http://www.cpearson.com/excel/topic.aspx

Regards,
Ryan--

--
RyGuy


"ShaneDevenshire" wrote:

Hi,

Let's assume you are using Excel 2003 or earlier:

1. In cell C2 enter the formula COUNTIF(A$2:A$516,B2) copy it down the 1600
rows.
2. Choose Filter, Auto Filter
3. Open the auto filter on column C and choose Custom, Does not equal and
set the value to 0 (zero) This will hide all the rows that are not
duplicates.
4. Select the items in column B and press Delete (if you are using a
version before 2002 let us know). This will remove all the duplicates.
5. Turn off the filters.
6. Highlight column B and sort it. Clear column C.


--
Cheers,
Shane Devenshire


"Lkyred19" wrote:

There is data in Column 'A' (514 Records) that will also be in Column 'B'
(1600 Records), I want excel to compare ColA to ColB and remove from B the
duplicate information in A. The end result should Column B without the
duplicate records from A. How do I do this?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return Unique Records ... No Blanks Ken Excel Discussion (Misc queries) 4 September 6th 07 04:31 AM
Compare Value in Cell 1 to a List, Return Value if Match otherwise Return Null Ben Excel Discussion (Misc queries) 2 March 15th 07 01:02 AM
unique filter results in some non-unique records. Serials Librarian Excel Discussion (Misc queries) 2 May 26th 06 09:58 PM
Extract Unique Records from two lists MarkN Excel Worksheet Functions 3 November 11th 05 01:07 PM
How to compare 2 lists and return un-matched? RWR Excel Worksheet Functions 1 February 15th 05 10:25 PM


All times are GMT +1. The time now is 12:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"