Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dan
 
Posts: n/a
Default Compare data in two columns to find duplicates.

I have two columns of siganl names. Column A is "From" data. Column B is "To"
data. In some cases the dulpicates are the same signal path in reverse. An
example would be Col A: Pin_1 Col B: GND. Further down the list would be Col
A: GND Col B: Pin_1. I have 60,000+ rows of signal names. It would be great
to find the duplicates and eliminate doing twice the work.

Thanks
Dan

  #2   Report Post  
david
 
Posts: n/a
Default

Hm.

I inserted a Column C, D, E, & F.

C contains a copy of A.
D contains a unique ID for each row (just auto-numbered 1-whatever)
E and F contain formulas that do comparisons on the To and From fields
respectively.

I named columns A-D checkTo and named columns B-D checkFrom.

For E (the To comparison), each cell has this formula:

=IF(VLOOKUP(A2,checkFrom,2,0)=B2,VLOOKUP(A2,checkF rom,3,0),0)

This says: IF a lookup of the To value in the From list yields a match AND
the respective To value of the From match = the From value THEN display the
ID for that record. IF the lookup succeeds but the respective To value
doesn't match the From value, display a 0. IF the lookup fails, excel simply
displays #N/A.

The F column does the reverse, doing lookups on the From value:

=IF(VLOOKUP(B2,checkTo,2,0)=C2,VLOOKUP(B2,checkTo, 4,0),0)

IF a lookup of the From value in the To list yields a match AND the
respective From value of the To match = the To value THEN display the ID for
that record. Otherwise, as with the other formula, display a 0 or #N/A.

Just remember that both matches will reference each other's ID, so be
careful not to delete both duplicates...

"Dan" wrote:

I have two columns of siganl names. Column A is "From" data. Column B is "To"
data. In some cases the dulpicates are the same signal path in reverse. An
example would be Col A: Pin_1 Col B: GND. Further down the list would be Col
A: GND Col B: Pin_1. I have 60,000+ rows of signal names. It would be great
to find the duplicates and eliminate doing twice the work.

Thanks
Dan

  #3   Report Post  
Dan
 
Posts: n/a
Default

David,

Thanks, that worked great! This will save alot of time.

"david" wrote:

Hm.

I inserted a Column C, D, E, & F.

C contains a copy of A.
D contains a unique ID for each row (just auto-numbered 1-whatever)
E and F contain formulas that do comparisons on the To and From fields
respectively.

I named columns A-D checkTo and named columns B-D checkFrom.

For E (the To comparison), each cell has this formula:

=IF(VLOOKUP(A2,checkFrom,2,0)=B2,VLOOKUP(A2,checkF rom,3,0),0)

This says: IF a lookup of the To value in the From list yields a match AND
the respective To value of the From match = the From value THEN display the
ID for that record. IF the lookup succeeds but the respective To value
doesn't match the From value, display a 0. IF the lookup fails, excel simply
displays #N/A.

The F column does the reverse, doing lookups on the From value:

=IF(VLOOKUP(B2,checkTo,2,0)=C2,VLOOKUP(B2,checkTo, 4,0),0)

IF a lookup of the From value in the To list yields a match AND the
respective From value of the To match = the To value THEN display the ID for
that record. Otherwise, as with the other formula, display a 0 or #N/A.

Just remember that both matches will reference each other's ID, so be
careful not to delete both duplicates...

"Dan" wrote:

I have two columns of siganl names. Column A is "From" data. Column B is "To"
data. In some cases the dulpicates are the same signal path in reverse. An
example would be Col A: Pin_1 Col B: GND. Further down the list would be Col
A: GND Col B: Pin_1. I have 60,000+ rows of signal names. It would be great
to find the duplicates and eliminate doing twice the work.

Thanks
Dan

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
Find data in columns, then place in rows couriced Excel Worksheet Functions 2 September 29th 05 05:44 PM
Data in table, may need to convert to columns with OFFSET? Ron H Excel Discussion (Misc queries) 5 July 31st 05 06:44 PM
How can I compare two lists of data (channel lineups) - find what. mf4852 Excel Worksheet Functions 3 February 6th 05 05:59 PM
Pulling data from 1 sheet to another Dave1155 Excel Worksheet Functions 1 January 12th 05 06:55 PM
Another question on how to find duplicate data Eroc Excel Worksheet Functions 2 December 14th 04 06:03 AM


All times are GMT +1. The time now is 10:31 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"