# Basic VLOOKUP question

This is a discussion on Basic VLOOKUP question within the Excel Questions forums, part of the Question Forums category; Am I correct in assuming that the data in a vlookup formula has to be "sorted" before the lookup will ...

1. ## Basic VLOOKUP question

Am I correct in assuming that the data in a vlookup formula has to be "sorted" before the lookup will function correctly?
My problem is that I have a list of 50 Clients in B3 to B54. To the right in column C I have the corresponding client contact name.
When the Client is selected from a drop down box, I would like the contact name to appear also (in another cell), but I cannot sort the clients into alphabetical order because I have the most frequent client a the top of the list, and there's also the possibility of adding further clients, and this will be done by non experieced operators. Any suggestions people?

I'm not worthy

2. ## Re: Basic VLOOKUP question

Originally Posted by atmospheric
Am I correct in assuming that the data in a vlookup formula has to be "sorted" before the lookup will function correctly?
My problem is that I have a list of 50 Clients in B3 to B54. To the right in column C I have the corresponding client contact name.
When the Client is selected from a drop down box, I would like the contact name to appear also (in another cell), but I cannot sort the clients into alphabetical order because I have the most frequent client a the top of the list, and there's also the possibility of adding further clients, and this will be done by non experieced operators. Any suggestions people?

I'm not worthy
Using False (0) , an exact match, as the 4th argument, would not require you to sort your table.

3. ## Re: Basic VLOOKUP question

As a side note, if you have duplicate entries, VLOOKUP will pick up the first entrie's value in the list.

Hey, there's an idea! It be cool if you could specify which entry you want, such as the first, second, third, last, etc.

4. ## Re: Basic VLOOKUP question

Thanks for the quick response guys, but sorry Maui, I didn't understand your comments, can you give me an example please? and T, thanks, but there won't be any duplicates.

5. ## Re: Basic VLOOKUP question

If Brian doesn't mind...

******** ******************** ************************************************************************>
 Microsoft Excel - Book2 ___Running: xl2002 XP : OS = Windows XP
 (F)ile (E)dit (V)iew (I)nsert (O)ptions (T)ools (D)ata (W)indow (H)elp (A)bout
 F2F4 =

B
C
D
E
F
G
1
******
2
aa1*a#N/A*
3
bb2****
4
cc3**5*
5
dd4****
6
a5****
7
******
 Sheet2 *

[HtmlMaker 2.32] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.

Note the two very similar formulas. The only difference is the 0 at the end. The 0 tells the function to look for an exact match. The first formula looks for an approximate match, but because the table is not sorted in order I get #N/A.

Does this help?

6. ## Re: Basic VLOOKUP question

Your list does not have to be soted
Clients are different
Names can be the same for different Clients

Assume your dropdown list is in cell D3,
place this formula in cell E3.

=VLOOKUP(\$D3,\$B\$3:\$C\$54,2,FALSE)

you can use autofill or copy and paste if you have multilple cells

if you get #N/A in blank cells
=IF(ISNA(VLOOKUP(\$D3,\$B\$3:\$C\$54,2,FALSE)),"",(VLOOKUP(\$D3,\$B\$3:\$C\$54,2,FALSE)))

If your dropdown list is in another cell, substitute the cell name in the formula.

7. ## Re: Basic VLOOKUP question

Thanks guys, (and Gals?), I'll try those and get back to you.

I'm not worthy

8. ## Re: Basic VLOOKUP question

Originally Posted by newshound12
Your list does not have to be soted
It doesn't??? See my post above.

Edit: Ah, yes, for the OP's specific problem. You are correct.

9. ## Re: Basic VLOOKUP question

Originally Posted by tbardoni
As a side note, if you have duplicate entries, VLOOKUP will pick up the first entrie's value in the list.

Hey, there's an idea! It be cool if you could specify which entry you want, such as the first, second, third, last, etc.
Todd,

This might be of interest to you......

http://216.92.17.166/board2/viewtopi...hlight=vlookup

10. ## Re: Basic VLOOKUP question

http://homepage.ntlworld.com/noneley/
for a list of excel functions with examples
comes in very handy for me

Page 1 of 2 12 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•