Comparing two lists

Closed
Steve - Jan 28, 2012 at 10:59 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Jan 28, 2012 at 10:19 PM
Hello,
So I am really stupid, I need the exact code and where to put it.

I have two separate sheets

Sheet 1 has

1
2
3
4
5
6
7
8


Sheet 2 has

2
4
6
8

I need a way to locate all occurrences of sheet 2 in sheet 1

I need someone who can tell me the exact forumla to put in colum b or whatever to make the comparison

Steve

1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Jan 28, 2012 at 10:19 PM
suppose your sheet 1 is like this
data
1
2
3
4
5
6
7
8

in B2 type this formula(or copy paste)

=IF(COUNTIF(Sheet2!$A$1:$A$4,Sheet1!A2)=1,"yes","no")

copy B2 down.

modify formula depending upon the configuration of sheet 2(particularly the item "Sheet2!$A$1:$A$4"
0