Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Compare 2 columns for unique values

Hello,

I am wondering if someone could offer some assistance. I have 2 columns
in a worksheet. The two columns are lists of server names. I would like
to compare the list in column A and Column B and either output or
highlight unique values. I basically need to figure out what column A
is missing from column B and vice versa. I appreciate any help anyone
can offer. Thank you.

Jim Gregg

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Compare 2 columns for unique values


Hi Jim

Not sure if there is a unique function that would help, but here are a
couple of ways (as usual there is normally more then one way of doing
things);

1. Import each list into Access as seperate tables and run an unmatched
query

2. the follwoing code will loop down one list checking for a match, you
could then do the same for the second list.

intCompare = 0

For Each r In Range("CheckList1")
a = UCase(r.Value)
b = UCase(r.Offset(0, 2).Value)

For Each s In Range("CheckList2")
c = UCase(s.Offset(0, 9).Value)
d = UCase(s.Offset(0, 10).Value)
If b = c And a = d Then
intCompare = 2
strCaseID = s.Value
r.Offset(0, 3).Value = intCompare
r.Offset(0, 4).Value = strCaseID
intCompare = 0
strCaseID = ""
Exit For
End If
Next s
Next r

Hope this helps


--
BadgerMK
------------------------------------------------------------------------
BadgerMK's Profile: http://www.excelforum.com/member.php...o&userid=31406
View this thread: http://www.excelforum.com/showthread...hreadid=511043

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Compare 2 columns for unique values

in column C, put in a formula like

In C1 put in
=if(Countif($B:$B,A1)=0,"Unique to A","")

In D1 put in
=if(countif($A:$A,B1)=0,"Unique to B","")

Select C1:D1 and drag fill down

--
Regards,
Tom Ogilvy


"Jim Gregg" wrote in message
oups.com...
Hello,

I am wondering if someone could offer some assistance. I have 2 columns
in a worksheet. The two columns are lists of server names. I would like
to compare the list in column A and Column B and either output or
highlight unique values. I basically need to figure out what column A
is missing from column B and vice versa. I appreciate any help anyone
can offer. Thank you.

Jim Gregg



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Compare 2 columns for unique values

Thank you both. I will try these out and let you know.

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
Compare data in 2 columns for unique values Steve C[_2_] Excel Discussion (Misc queries) 2 November 29th 07 04:26 PM
Compare several columns of data and display unique ones [email protected] Excel Discussion (Misc queries) 0 March 13th 07 04:12 PM
Compare different columns and put unique data in the next available column [email protected] Excel Discussion (Misc queries) 0 March 13th 07 03:22 PM
Compare 2 columns and put unique data in column 3 [email protected] Excel Discussion (Misc queries) 2 March 7th 07 02:54 PM
Compare and copy unique values sa02000 Excel Worksheet Functions 1 June 12th 06 09:42 PM


All times are GMT +1. The time now is 06:50 AM.

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"