Microsoft Office Forums


Reply
Thread Tools Display Modes

compare 2 columns

 
 
sndesai74@gmail.com
Guest
Posts: n/a

 
      04-20-2006, 06:54 PM
Hi all,

Can some one help me for my following question?

I have some data in column A, and some in column C. For example,

Column A

1
2
3
4
5
6
7
8
9
10

Column C

2
4
5
6
7

Now, I want to compare A2:A11 against C2:C6. Here is the question: If a
number in column A do not exist in column C, enter that in Column B;
otherwise if column A number exist in column C, do nothing or leave it
blank. Like 1,3,8,9,10 do not exist in column C, so they should appear
in column B.

Thank you for your help.

 
Reply With Quote
 
 
 
 
Puppet_Sock
Guest
Posts: n/a

 
      04-20-2006, 09:50 PM

(E-Mail Removed) wrote:
> Hi all,
>
> Can some one help me for my following question?
>
> I have some data in column A, and some in column C. For example,
>
> Column A
>
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
>
> Column C
>
> 2
> 4
> 5
> 6
> 7
>
> Now, I want to compare A2:A11 against C2:C6. Here is the question: If a
> number in column A do not exist in column C, enter that in Column B;
> otherwise if column A number exist in column C, do nothing or leave it
> blank. Like 1,3,8,9,10 do not exist in column C, so they should appear
> in column B.


If it were me, I'd write some VBA to do this. It wouldn't be too
difficult
in VBA. You could be exactly as fancy as you needed. For example,
you could have the code copy the data in the original order, sort it
in place, do the compare, create the extra column, then put the data
back in the original order.

It's just barely possible that Filter might do something for you, but
I never got very good at using it.
Socks

 
Reply With Quote
 
Herbert Seidenberg
Guest
Posts: n/a

 
      04-21-2006, 02:49 AM
This will use Advanced Filter.
Add headers to your data like this:

ListA ListB ListC
1 1 2
2 3 4
3 8 5
4 9 6
5 10 7
6
7
8
9
10

Criteria
Test
TRUE

Select these 11 cells: header <ListA> and 1 thru 10
Insert > Name > Create > Top Row
Do likewise for ListC and Criteria.
Again select ListA and its header
Insert > Name > Define > Names in Workbook > type Database
Into the cell that says TRUE, enter this formula:
=NOT(COUNTIF(ListC,ListA))
Data > Filter > Advanced Filter
>Copy to another location
>List Range: type Database
>Criteria Range: type Criteria
>Copy To: select a cell in column B


 
Reply With Quote
 
Edson
Guest
Posts: n/a

 
      04-24-2006, 08:00 PM
insert this formula in B2 cell:
=IF(ISNA(MATCH(A2;C:C;0));A2;"")
copy B2 and paste in B3:B11

<(E-Mail Removed)> escreveu na mensagem
news:(E-Mail Removed) oups.com...
> Hi all,
>
> Can some one help me for my following question?
>
> I have some data in column A, and some in column C. For example,
>
> Column A
>
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
>
> Column C
>
> 2
> 4
> 5
> 6
> 7
>
> Now, I want to compare A2:A11 against C2:C6. Here is the question: If a
> number in column A do not exist in column C, enter that in Column B;
> otherwise if column A number exist in column C, do nothing or leave it
> blank. Like 1,3,8,9,10 do not exist in column C, so they should appear
> in column B.
>
> Thank you for your help.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
compare cells in two columns Easydoesit Excel Newsgroup 1 05-10-2005 06:09 AM
Compare two columns datas Franck Excel Newsgroup 1 04-18-2005 09:57 AM
Compare 2 columns in a spreadsheet Sam Excel Newsgroup 1 04-02-2005 01:58 AM
Compare columns TerryM Excel Newsgroup 2 06-18-2004 10:39 PM
Compare data in columns Beth Excel Newsgroup 0 07-07-2003 05:33 PM



All times are GMT. The time now is 02:11 PM.