Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing Data

Status
Not open for further replies.

RaDevi

Technical User
May 18, 2011
1
IN

Hello

I've got two separate worksheets as given bellow, I need to be able to compare the two columns and get result in sheet3 as given bellow.


Sheet 1:
Colum 1
AA
BB
CC
DD
EE
FF
GG
HH
II
JJ


Sheet 2:
Colum 1
AA
CC
FF
GG
II


But i want

Sheet 3:
BB
DD
EE
HH
JJ

Can this be done?
 


Hi,

Paste both lists contiguously in the same column.

Assuming that this is all in column A, in column B...
[tt]
=countif(A:A,A1)
[/tt]
and copy down.

sort on column B

Delete rows with counts greater than 1


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
The solution depends on exactly what you want to do. There are two obvious things you might be trying to do:
(1) remove all items from sheet 1 which are also in sheet 2
(2) remove all items that are present on both sheets.

Skip's excelent solution solves problem 2. If you have things that are in sheet 2 but not sheet 1, they will also appear on sheet 3.

If you wish to solve exclusively problem 1, you could do almost the same. Just countif with your lists in place, rather than pasted contiguously. For simplicity, I put both lists on the same sheet, list 1 in column A, list 2 in column B. In this case use C1 = countif(B:B, A1), copy down. The copy everything, paste as value on sheet 3, sort by column C, and keep only rows with zero.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top