View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
MrAcquire MrAcquire is offline
external usenet poster
 
Posts: 62
Default Vlookup to look up multiple fields?

Here's one way. If the Part#-Oper combinations are mutually exclusive (no
duplicates) in your Sheet1 database, you can use SUMPRODUCT in Sheet2 as a
lookup. Assuming a Sheet1 database of A1..C100, in Sheet2, cell C2, enter

SUMPRODUCT((A2=Sheet1!$A$2:$A$100)*(B2=Sheet1!$B$2 :$B$100)*(Sheet1!$C$2:$C$100))

Copy down.

"Cam" wrote:

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