ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Compare two lists (https://www.excelbanter.com/excel-discussion-misc-queries/145845-compare-two-lists.html)

ExcelInExcel

Compare two lists
 
I have two lists list1 and list2

List 1 List 2
a b
b d
c e
d
e

Is there a way I can get the items in List2 that already exist in List 1
(b,d,e). It looks simple for the lists above but when I have lists with 100
or so items, it is not so easy.

thinking about it, will a vlookup do the job?

T. Valko

Compare two lists
 
One way:

Assuming your lists are in columns A and B. Enter this formula in column C
and copy down to the end of the list in column B:

=IF(ISNUMBER(MATCH(B2,A$2:A$6,0)),"x","")

X = exists in column A

Biff

"ExcelInExcel" wrote in message
...
I have two lists list1 and list2

List 1 List 2
a b
b d
c e
d
e

Is there a way I can get the items in List2 that already exist in List 1
(b,d,e). It looks simple for the lists above but when I have lists with
100
or so items, it is not so easy.

thinking about it, will a vlookup do the job?




Farhad

Compare two lists
 
Hi,

use a helper column in list 2 and enter this formula:
=VLOOKUP(list2!A1,list1!$A$1:$A$100,1,false)
copy drag down the formula to where ever you need

Thanks,
--
Farhad Hodjat


"ExcelInExcel" wrote:

I have two lists list1 and list2

List 1 List 2
a b
b d
c e
d
e

Is there a way I can get the items in List2 that already exist in List 1
(b,d,e). It looks simple for the lists above but when I have lists with 100
or so items, it is not so easy.

thinking about it, will a vlookup do the job?



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

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