macro comparing values from 2 worksheets

D

Don Doan

Hi,
I need some help with is problem. I have 2 worksheets. The first worksheet
has 2 columns called "Security ID" and "Security Name" in column A and B. The
second worksheet also has 2 columns with the same heading but in column E and
F.

I like to compare each row in column E and F in the second worksheet against
all in column A and B in the first worksheet. If it found something both are
identical (both the ID and Name), then put a "y" in column G in the second
worksheet. Otherwise, put "n".

All elements in columns mentioned above are in text format.
This is an example of how one worksheet looked like:

Security ID Security Name
NC123456 NORTEL INVESTMENT
DD123456 JAMES BOND INVESTMENT

Thanks a bunch.
 
J

Jim Thomlinson

Give this formula a try... Change the sheet name and range size to suit.

=IF(SUMPRODUCT(--(E2=Sheet1!$A$2:$A$10), --(F2=Sheet1!$B$2:$B$10))>=1, "Y",
"N")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top