ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro comparing values from 2 worksheets (https://www.excelbanter.com/excel-programming/404853-macro-comparing-values-2-worksheets.html)

Don Doan

macro comparing values from 2 worksheets
 
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.

Jim Thomlinson

macro comparing values from 2 worksheets
 
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")
--
HTH...

Jim Thomlinson


"Don Doan" wrote:

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.



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

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