ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Vlookup with more than 1 criteria (https://www.excelbanter.com/excel-discussion-misc-queries/161697-vlookup-more-than-1-criteria.html)

EoinL

Vlookup with more than 1 criteria
 
Dog brown 25
Dog Grey 28
Cat Blue 30
Rabbit Brown 12
Dog grey 18

Can the vlookup function be used to lookup more than one value in a row and
return a single corresponding value?

In the example below I want to return the value 25. But if I lookup "dog",
there's two and if I look up "brown" there's also two so I need to lookup dog
and brown together?


Mike H

Vlookup with more than 1 criteria
 
How about:-

=SUMPRODUCT((A1:A5="Dog")*(B1:B5="Brown")*(C1:C5))

You don't say what you want if you searched for Grey dogs, this would return
46

Mike

"EoinL" wrote:

Dog brown 25
Dog Grey 28
Cat Blue 30
Rabbit Brown 12
Dog grey 18

Can the vlookup function be used to lookup more than one value in a row and
return a single corresponding value?

In the example below I want to return the value 25. But if I lookup "dog",
there's two and if I look up "brown" there's also two so I need to lookup dog
and brown together?


Max

Vlookup with more than 1 criteria
 
If you want to lookup and return only the 1st match for the dual criteria

Array-entered, press CTRL+SHIFT+ENTER to confirm the formula:
=INDEX(C1:C5,MATCH(1,(A1:A5="Dog")*(B1:B5="Grey"), 0))

Based on your sample data, above will return: 28
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"EoinL" wrote:
Dog brown 25
Dog Grey 28
Cat Blue 30
Rabbit Brown 12
Dog grey 18

Can the vlookup function be used to lookup more than one value in a row and
return a single corresponding value?

In the example below I want to return the value 25. But if I lookup "dog",
there's two and if I look up "brown" there's also two so I need to lookup dog
and brown together?



All times are GMT +1. The time now is 01:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com