Google Answers Logo
View Question
 
Q: Microsoft Excel - comparing columns ( No Answer,   1 Comment )
Question  
Subject: Microsoft Excel - comparing columns
Category: Computers > Software
Asked by: arizohioan-ga
List Price: $10.00
Posted: 15 Jun 2006 16:30 PDT
Expires: 15 Jul 2006 16:30 PDT
Question ID: 738541
I have two columns of stock symbols - A and B.  I want to create 3 new
columns.  Column C will tell me which symbols are in both A & B. 
Column D will tell me which symbols are in A but not in B.  Column E
will tell me which symbols are in B but not in A.

Thanks
Answer  
There is no answer at this time.

Comments  
Subject: Re: Microsoft Excel - comparing columns
From: anhebetude-ga on 16 Jun 2006 16:43 PDT
 
Lets assume that Column A has 26 values and Column B has 13 values. 
The following formulas should work for any ranges, simply substitute
the actual for the assumed wherever you see 26 or 13 below.

I am assuming that the Column A values begin in A1 and go to A26 and
that the Column B values being in B1 and go to B13.

In C1 enter: =IF(COUNT(MATCH(B1,$A$1:$A$26,0)),B1,"")

Copy this formula into the cells C1:C13 and Column C will now display
the values found in both Column A and Column B.

In D1 enter: =IF(COUNT(MATCH(A1,$C$1:$C$13,0)),"",A1)

Copy D1 and paste this formula into cells D1:D26 and into cells E1:E13.

Column D will now display symbols in A that are not in B, and Column E
will now display symbols in B that are not in A.

To remove any blank spaces between the values in Columns C, D, and E,
you will first want to remove the formulas.  To do this, select the
entire spreadsheet (you can click the blank square left of the A
column), copy, then go to edit and 'paste special'.  Select values and
hit OK.  You can now use the Sort function in the data menu for any
column you want to remove blank spaces in.

I hope this answers your question.  I found the trick of how to do
this tucked away at the following link:

http://www.emailoffice.com/excel/arrays-bobumlas.html

Search strategy: determine whether a value is in a list excel

Yours truly,
anhebetude

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy