comparing columns

felber

New Member
Joined
Mar 25, 2002
Messages
1
I often have two long columns of data, of varying length, that I need to compare. I need to take each cell in B, see if it matches any cells in A, and if it doesn't put the contents of B into C. I am new to excel and would appreciate any help. Thanks.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi,

You might want to try the mixed Vlookup and IF functions:

=if(iserror(vlookup(b1,$A$1:$A$10,1,false)),b1,vlookup(b1,$A$1:$A$10,1,false))

The above formula is entered into c1, and copy it all the way down until there's no values in column b.

Meaning of the above formula is, if looking up value in B1, exists in column A or range A1 to A10, then retrun the value from Column A, otherwise return the value from B1.

Once the formula is copied down, the reference cell b1 should change, ie formula in c2 would reference to b2, so on.

HTH
 
Upvote 0
Sorry, BabyTiger, but I think what is required in C is the value in B if B is not in A, otherwise nothing. If so, try this
=IF(ISNA(MATCH(B1,$A$1:$A$1000,0)),B1,"") in Cl.
Change $A$1000 to the range you need, and copy down as far as the bottom of column B data.

The again, I could be barking up the wrong tree.

Richard
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,172
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top