Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Comparing common values in either different worksheets or columns | Excel Discussion (Misc queries) | |||
Comparing worksheet values in two worksheets | Excel Worksheet Functions | |||
Macro Help Needed: Comparing cell values and deleting rows | Excel Discussion (Misc queries) | |||
Macro for comparing 2 values (number and date) | Excel Programming | |||
Calculating values with macro between worksheets | Excel Programming |