Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing common values in either different worksheets or columns Cesar Excel Discussion (Misc queries) 1 May 7th 09 03:49 AM
Comparing worksheet values in two worksheets DesparateDave! Excel Worksheet Functions 1 August 3rd 07 01:16 PM
Macro Help Needed: Comparing cell values and deleting rows [email protected] Excel Discussion (Misc queries) 1 September 19th 06 02:39 AM
Macro for comparing 2 values (number and date) marthab Excel Programming 2 August 19th 04 10:21 PM
Calculating values with macro between worksheets spolk[_3_] Excel Programming 2 May 12th 04 04:59 PM


All times are GMT +1. The time now is 01:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"