Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing 2 Columns in Excel

Status
Not open for further replies.

fishax

MIS
Sep 11, 2002
81
CA
Hi,
Not a programmer, so I need some help in this area. If I have 2 columns in Excel containing text and I need to compare if Text in a certain Column 1(text can have spaces) EXACTLY MATCHES Text ANYWHERE in Column 2, if it doesn't, I want it to write out the whole Row into A different Column 3.

In other words, I want it to be able to take every Text Row in Column 1, and Compare it to the text in Column 2 for EVERY ROW. If no match, then write that particular Column 1 text to Column 3.

How would I accomplish this. Any examples or references to examples would help. Or even a tool I could use for this?
 
I believe you need to utilize the vlookup function in XL [yinyang] Tranpkp [pc2]
 
If I understand you, you are starting with something like:
Code:
NEW_DATA    CURRENT_LIST
Code:
Johnson     Smith
Johanson    Jones
Jones       Brown
Snyder      Green
Smith
Goodbody
and want to end up with something like this (you can sort column 3 to get rid of the blank lines):
Code:
NEW_DATA    CURRENT_LIST    NEED_TO_ADD
Code:
Johnson     Smith           Johnson
Johanson    Jones           Johanson
Jones       Brown
Snyder      Green           Snyder
Smith
Goodbody                    Goodbody
If that is a correct understanding, then you can put this formula in C2 and copy it down as far as necessary:
Code:
   =IF(ISNA(MATCH(A2,$B$2:$B$5,0)),A2,"")
Then you can use copy/paste special values to convert the formulas to data and sort the column to bring all of the values together.

If it is something else you need, please provide an example of the data and layout so that your meaning can be made clear.
 
Well, this is exactly what I want, but Copying/Pasting the Formula, converting to values is not displaying the DATA. All I see is the formula. Am I missing something?
 
What exactly do you see in cell C2 after pasting the formula? If you copied and pasted according to instructions you should see the formula in the formula edit box and either blank or the contents of A2 in the cell (according to whether the contents of A2 exists anywhere in column B. -- Test by changing the contents of A2.)

Perhaps you missed the equal sign when you copied from the post?

BTW you will need to adjust the range reference in the formula from
Code:
$B$2:$B$5
to whatever the range of data in column B really is for your specific situation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top