#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
teejay
 
Posts: n/a
Default compare lists

Hello All,

I usually have to compare list of genes to find out which genes are common
in the lists, so I usually use http://jura.wi.mit.edu/bioc/tools/compare.html

But wondering how do I do it if I have got more than 2 lists.

Also, is there any way that I can compare these lists in the worksheet and
highlight common entries?

Many thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete
 
Posts: n/a
Default compare lists

Assuming you have one list in column A (the longer one), and the other
list in column B (the shorter one), both starting on row 2 with a
header row on row 1, enter this formula in cell C2:

=IF(ISNA(MATCH(B2,A$2:A$250,0)),"",B2)

This assumes the first list in column A occupies A2 to A250 - adjust to
suit. Copy this formula down for as many entries as there are in column
B (double-click the fill handle). This will list the common entries and
will return a blank if there is no match - you could fix the values
with paste special, then sort the items in this list so that the blanks
drop to the bottom.

Hope this helps.

Pete

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete
 
Posts: n/a
Default compare lists

Sorry, I missed your first question. Using the common list from column
C in conjunction with a third list, the same approach can be taken to
give you another list which is common to all three original lists.
Apply the same for 4 or more lists.

Hope this helps

Pete

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
teejay
 
Posts: n/a
Default compare lists

So by this method I guess I will be doing pairwise comparison, Isnt there any
option to compare more than two lists, all at once?

"Pete" wrote:

Sorry, I missed your first question. Using the common list from column
C in conjunction with a third list, the same approach can be taken to
give you another list which is common to all three original lists.
Apply the same for 4 or more lists.

Hope this helps

Pete


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
teejay
 
Posts: n/a
Default compare lists

This formula of your works but I have to have a seperate column to get the
common entries, how do I do it so that I just highlight the common entries in
parent column (as I need to know their order (ranking) number)

Thanks for your inout



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete
 
Posts: n/a
Default compare lists

Well, you will need at least one extra column to put formulae in.

You might like to try conditional formatting on your 2 columns of data
to highlight the ones in common (I'm not sure what you mean by
"ranking"). Following what I gave you before, highlight the cells in
column A from A2 to A250 (adjust this as necessary). Then select Format
| Conditional Formatting then in the panel presented select "Cell Value
is" and "equal to" then in the third panel enter the formula:

=INDEX($C$2:$C$150,MATCH(A2,$C$2:$C$150,0),1)

assuming your third list occupies C2 to C150 (adjust as necessary).
Then click the Format button, select the Patterns tab, choose bright
Yellow, then OK your way out. This should highlight the cells in column
A which contain values which are also in column B (duplicates allowed).
You can apply the same approach to the data in column B - just change
the A2 in the middle of the formula to B2.

Is this the effect you were after?

Pete

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default compare lists

This was most helpful and simple to do. Most of the other aswers are for
very seasoned excel users and difficult to understand. This worked for me!
Thanks Pete

"Pete" wrote:

Assuming you have one list in column A (the longer one), and the other
list in column B (the shorter one), both starting on row 2 with a
header row on row 1, enter this formula in cell C2:

=IF(ISNA(MATCH(B2,A$2:A$250,0)),"",B2)

This assumes the first list in column A occupies A2 to A250 - adjust to
suit. Copy this formula down for as many entries as there are in column
B (double-click the fill handle). This will list the common entries and
will return a blank if there is no match - you could fix the values
with paste special, then sort the items in this list so that the blanks
drop to the bottom.

Hope this helps.

Pete


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 2 LISTS AND SEE COMBINED RESULTS BY CATEGORY Tony Excel Discussion (Misc queries) 0 December 27th 05 11:00 PM
Compare two lists? s_tyrone Excel Discussion (Misc queries) 1 November 30th 05 02:47 PM
Excel - need a function to compare lists JerryMatson Excel Worksheet Functions 1 November 24th 05 04:09 PM
compare two lists rob p Excel Discussion (Misc queries) 3 October 10th 05 07:01 PM
How do I compare lists and eliminate duplictates kateshere Excel Discussion (Misc queries) 2 July 11th 05 08:39 PM


All times are GMT +1. The time now is 08:54 PM.

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

About Us

"It's about Microsoft Excel"