Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 389
  • Last Modified:

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
Asked:
Jeremy-M
2 Solutions
 
Rgonzo1971Commented:
Hi,

pls try Index and Match

=INDEX(A2:B6,MATCH(D2,A2:A6,0),2)

Open in new window

Regards
indexMatch.xlsx
0
 
KCTSCommented:
Here its the solution using VLOOKUP
vlookup.xlsx
0
 
MINDSUPERBCommented:
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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
Saqib Husain, SyedEngineerCommented:
You can use a vlookup with the last argument 0

like

=Vlookup(C2,$A$1:$B$100,2,0)
0
 
Rob HensonIT & Database AssistantCommented:
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
 
Jeremy-MAuthor 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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now