Click here to Skip to main content
15,894,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,

i need compare two multiple values from excel column and compare result comes third column. please find below my requirements example.

thanks in advance.

Column 1Column 2
Scott; Eglise; Endacott; Fido; Green; Hibbard; OlneyScott; Olnei; Endacot; Fido; Green; White; Hibbard; Eglise


Compare result as follows:
Olney; Endacott; White

kindly any one help me.
Posted
Updated 28-Jun-13 5:38am
v2

1 solution

To make things easier give the data in column 1 a Name e.g. "List".

First part of your calculation then needs to do a VLOOKUP() on that list, looking for an exact match.

VLOOKUP returns #N/A if it can't find the data so you will also need a function called ISNA() which returns TRUE if a cell contains, or a function returns, #N/A

Because you actually want to list the ones that don't match you'll also need the function NOT() to reverse the effects of the lookup.

Finally put all of this together into an IF() function in your formula returning a blank for the true part and the item from column 2 in the false part

[Edit - worked example]
I have your column 1 values in "Column A" and column 2 values in "Column B". I've used Insert, Name, Define to call all the data in Column B List. I then sorted column A and column B just to make it easier to view the results

First part of calculation is
=VLOOKUP(A1, List, 1, FALSE)
which returns results
Eglise	Eglise	Eglise
EndacottEndacot	#N/A
Fido	Fido	Fido
Green	Green	Green
Hibbard	Hibbard	Hibbard
Olney	Olnei	#N/A
Scott	Scott	Scott
	White	#N/A
If I wrap that in the ISNA() function and then in the NOT() function ...
=NOT(ISNA(VLOOKUP(A1, List, 1, FALSE)))
then I get results
Eglise	Eglise	TRUE
EndacottEndacot	FALSE
Fido	Fido	TRUE
Green	Green	TRUE
Hibbard	Hibbard	TRUE
Olney	Olnei	FALSE
Scott	Scott	TRUE
	White	FALSE

Finally, put that into an IF() statement to tidy up the output ...
=IF(NOT(ISNA(VLOOKUP(A1, List, 1, FALSE))), "", B1)

Which gives results
Eglise	Eglise	
EndacottEndacot	Endacot
Fido	Fido	
Green	Green	
Hibbard	Hibbard	
Olney	Olnei	Olnei
Scott	Scott	
	White	White

Which is very close to what you said your expected results were. I suspect you have a typing error in there as you appear to be trying to merge results from two columns. However this worked example should be enough to set you down the right path
 
Share this answer
 
v2
Comments
Pandiarajan A 27-Jun-13 21:44pm    
my friend i am not clear your response. please send example formula. its very useful for me
CHill60 28-Jun-13 9:17am    
I've updated my solution working through an example
Pandiarajan A 1-Jul-13 1:43am    
many thanks for your valuable response

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900