View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Vlookup to look up multiple fields?

Try one of these:

This is an array formula**:

=INDEX(Sheet2!C$2:C$6,MATCH(1,(Sheet2!A$2:A$6=A2)* (Sheet2!B$2:B$6=B2),0))

Copied down as needed

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

This formula is normally entered but will only work if the combination of
lookup values are unique:

=SUMPRODUCT(--(Sheet2!A$2:A$6=A2),--(Sheet2!B$2:B$6=B2),Sheet2!C$2:C$6)

Copied down as needed

--
Biff
Microsoft Excel MVP


"Cam" wrote in message
...
Hello,

Is VLOOKUP function capable of looking at two criteria in the fields and
return the value? If yes, how to put in the code or if not is there any
other
way to achieve this? Thanks

Sample:
Sheet1 - data sheet (RESULT column is the vlookup)
Part# Oper RESULT
ABC1 20 50
ABC1 10 30
ABC3 10 30
ABC4 60 40
ABC4 70 100

sheet2 - Reference sheet
Part# Oper Time
ABC1 10 30
ABC1 20 50
ABC3 10 30
ABC4 60 40
ABC4 70 100