VLOOKUP TO COMPARE COLUMNS

carmella

New Member
Joined
Apr 17, 2003
Messages
17
i'm not sure i'm using the right formula, but i just can't get this to work with VLookup:

I have a doc1 with 599 names in column A. Some of them need to appear more than once. So you'd have the same name John in A1, A2 and A3.

I then inserted a column B with the same names, but only once, followed by column D, with their addresses. (columns D and E have additional information and also 599 records)

Now I need to make columns B and D also repeat the names and addresses. (or else the info in columns D and E won't match)

Basically, I want to look a value in A1, then compare it with column B and if it finds a match, insert it in C1.

any help appreciated.

C
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Place this in cell C1 and copy down.

=VLOOKUP(A1,$A$1:$B$599,2,FALSE)

Let me know if it doesn't work.
 
Upvote 0
This will return a blank instead of #N/A, which is listed when a matched isn't found.

=IF(ISNA(VLOOKUP(A1,$A$1:$B$599,2,FALSE)),"",VLOOKUP(A1,$A$1:$B$599,2,FALSE))
 
Upvote 0
The following version saves you from using the lookup twice.

=IF(ISNA(SETV(VLOOKUP(A1,B1:C50,2,FALSE))),"",GETV())
 
Upvote 0
Cam, answers like that are a big part of why I like this board. I use VLOOKUP almost daily, and I hate that #N/A garbagé. I've used the version posted by unit213, and that works, of course, but your's is a cleaner solution, AND, I learned something about writing formulae that will have a broader application.

Thanks!


attachment.php
 
Upvote 0
Hello, perhaps I have come to the right place. I am trying to figure something out. I have a list in Column A contains part numbers (including numbers and letters). I have a B Column contains another list with part numbers like Column A. I am trying to compare between the list and present those who match in a new Column... I can't figure out how to do that using the information I found in this forum topic. and if that's not enough, i have another column, with the information that is attached to Column A. i'll give you an example. in Column A1 i have the next Data: 1000116954. on Column C for instance, i have the description of what exactly is that part number shown in Column A: Microsoft Windows 7 Enterprise. i need to do the comparison between Column A and Column B and the results that comes out should also show the description that was "attached" to Column A to begin with. is that even possible? i am not even close to figure out how this can be done. i will deeply appreciate your help on this... thank you so much in advance. Roy
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,823
Members
449,049
Latest member
cybersurfer5000

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