Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default VLookup based on two criteria

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default VLookup based on two criteria

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))



wrote:

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


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default VLookup based on two criteria

On Aug 28, 5:45 pm, Dave Peterson wrote:
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))





wrote:

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


--

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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default VLookup based on two criteria

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.

wrote:

On Aug 28, 5:45 pm, Dave Peterson wrote:
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))





wrote:

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


--

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.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a row based on other criteria Joe Gieder Excel Worksheet Functions 4 June 15th 07 06:22 PM
Count or Sum based on more than 1 criteria Andrew C Excel Worksheet Functions 1 December 29th 05 09:46 PM
MIN within range based on criteria StevenL Excel Discussion (Misc queries) 9 July 11th 05 11:33 PM
Need help looking up value based on criteria akbreezo Excel Worksheet Functions 7 June 15th 05 10:53 PM
Lookup based on two criteria in 1 row BethP Excel Discussion (Misc queries) 3 April 12th 05 06:47 AM


All times are GMT +1. The time now is 09:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"