x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 392

# VLOOKUP does not work.

I have an Excel workbook of employees. One table has them ranked by seniority. The seniority table is not alphabetically ordered by name. I have tables for each department with a seniority column; however, I have been unable to create a formula that will search the employee worksheet and return the seniority rank, a number, of the employee.  VLOOKUP requires that the lookup table or array be ordered alphabetically. Any suggestions:

Employee Table                  Shipping Department
Name          Seniority            Name              Seniority
John Jones      1                     Chris Smith
Mary Brown      2                    Al Ryan
Walt Baker      3
Al Ryan            4
Chris Smith      5
0
Jeremy-M
2 Solutions

Commented:
Hi,

pls try Index and Match

``````=INDEX(A2:B6,MATCH(D2,A2:A6,0),2)
``````
Regards
indexMatch.xlsx
0

Commented:
Here its the solution using VLOOKUP
vlookup.xlsx
0

Commented:
Hello Jeremy-M,

You can actually use V-Lookup in your example by using a similar formula below:

=VLOOKUP(A2,'Employee Table'!\$A\$2:\$B\$6,2,FALSE)

Sincerely,

Ed
VlookUp.xlsx
0

EngineerCommented:
You can use a vlookup with the last argument 0

like

=Vlookup(C2,\$A\$1:\$B\$100,2,0)
0

Finance AnalystCommented:
To expand on the above two comments, VLOOKUP does NOT require the data to be sorted when using FALSE or 0 for the last parameter. The FALSE or 0 tell the formula to find an exact match regardless of sort order.

If this parameter is omitted, the data does have to be sorted in order for the CLOSEST match to be found. If the data is not in order the VLOOKUP will find the first match that is close to but not larger than the search value. So for example, the data below is not fully sorted:

55
76
96
77
43

Doing a vlookup for value 78 would return a match at the row with 76 whereas if the data was sorted it would return the result from finding the 77. Searching for 44 would give an error because the first result is already larger whereas sorted would give 43.

Thanks
Rob H
0

Author Commented:
The two answers I accepted worked.I learned a use of VLOOKUP that I was not aware would work and I learned more about using INDEX-MATCH I have awarded both of you an A for excellent and clear answers.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.