VLookup based on two criteria

  • Thread starter Thread starter the_cagey_one
  • Start date Start date
T

the_cagey_one

I've read through many posts on this topic but I've not been able to
find a solution to my problem.

On one tab I have six columns of information (table_array.) Column
"A" contains a machine name, Column "B" contains a fault name and
column "F" contains a time value (decimal minutes.) For each machine
there may be any number of faults associated to it. I am trying to
return the time value for a specific machine's fault name to a
corresponding cell on another tab in the same worksheet.

The lookup_value will come from another reference in the document; I
can work through that but cannot resolve the two criteria requirement
(machine and fault name) to pull in the time value.

Any response is appreciated.

KG
 
Saved from a previous post:

If you want exact matches for just two columns (and return a value from a
third), you could use:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))

(all in one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can only use the whole column in xl2007.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))

=================
So in your case, it may look like:

=index(othersheet!$f$1:$f$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))
 
Saved from a previous post:

If you want exact matches for just two columns (and return a value from a
third), you could use:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))

(all in one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can only use the whole column in xl2007.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))

=================
So in your case, it may look like:

=index(othersheet!$f$1:$f$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))











--

Dave Peterson- Hide quoted text -

- Show quoted text -

I ended up with using the sumproduct function. I will look at Dave
P's solution as well.

thanks all.
 
One of the differences is that the =sumproduct() will sum all the rows (column
F) that match the criteria.

The =index() will return the first value found--even if it's text.
 
Back
Top