Comparing two columns in excel using vlookup

AakritiR

New Member
Joined
Aug 18, 2010
Messages
3
Hi,

I want to compare two columns in excel and am using VLOOKUP for the same.

The criteria for search is:

Suppose column A and column B are to be compared.Column C is the resultant column.

1) I need to restrict my search till 4 characters in column B, as there are entries in the column A with only last few characters being different.
For ex:

Column A Column B
-------- --------
Confuse Confuse
Confusion Tradition


The syntax I am using is:
In column C (resultant column)
=VLOOKUP(LEFT(A2,5)&"*",B:B,1,FALSE) and then drag this for the entire column entry.

(But issue with this is that post comparing with column B and it displays what's there in column B as below:

Column A Column B Column C
-------- -------- --------
Confuse Confuse Confuse
Confusion Tradition Confuse

2) I want the comparision result to be picked from column A, so that I can get all kinds of similar entries from column A into the resultant column.

For ex:

Column A Column B Column C
-------- -------- --------
Confuse Confuse Confuse
Confusion Tradition Confusion



Could someone please help me in getting the above output??

Thanx in Advance
Regards,
Aakriti
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I am not sure i completely understood what you wanted to get but i think that this might help

=IF(ISNA(VLOOKUP(LEFT(A2,4)&"*",B:B,1,FALSE)),"Not the same",A2)
 
Upvote 0
Thank you so much Archijs. This is what i wanted.
Just wondering how come this didnt click my head. Silly me.

Anyway, thanks in tons. :)
 
Upvote 0
Thank you so much Archijs. This is what i wanted.
Just wondering how come this didnt click my head. Silly me.

Anyway, thanks in tons. :)

I wouldn't worry about it. I see it time & time again and I've also been guilty of it several times where we over analyse the situation and come at it with a sledge hammer with a simple fly squatter would be suffice.
 
Upvote 0
Possibly also this:

=IF(COUNTIF(B:B,LEFT(A2,4)&"*"),A2,"Not the same")
 
Upvote 0

Forum statistics

Threads
1,214,540
Messages
6,120,107
Members
448,945
Latest member
Vmanchoppy

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