Vlook up with multiple conditions

SimonaB

New Member
Joined
May 24, 2016
Messages
7
Hello,

I am in some trouble when trying to use vlook up with multiple conditions. I have read a few threads but I can't seem to make it work for my task.

Can you explain me on this example?
We have two products in two different storage locations each. I want to see sales matched with the stock here given that in my excel they are in different tables.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Product[/TD]
[TD]Warehouse[/TD]
[TD]Stock[/TD]
[TD][/TD]
[TD]Product[/TD]
[TD]Sales[/TD]
[TD]Warehouse[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]A[/TD]
[TD]100[/TD]
[TD][/TD]
[TD]123[/TD]
[TD]70[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]B[/TD]
[TD]150[/TD]
[TD][/TD]
[TD]1234[/TD]
[TD]25[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]A[/TD]
[TD]50[/TD]
[TD][/TD]
[TD]1234[/TD]
[TD]150[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]B[/TD]
[TD]200[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

I would kindly appreciate your help, it would be a life-saver!!

Thanks in advance!

Simona
 
This?


Excel 2010
ABCDEFGH
1ProductWarehouseStockProductSalesWarehouse
2123A10012370A100
3123B150123425A50
41234A501234150B200
51234B200
Sheet10
Cell Formulas
RangeFormula
H2{=INDEX($C$2:$C$5,MATCH(E2&G2,$A$2:$A$5&$B$2:$B$5,0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Whether single or multiple criteria, the Index(Match) can be an important alternative to VLOOKUP.
In many cases I prefer INDEX(MATCH) because of the large arrays I regularly deal with or the fact that I want to pull from the left of the matched value.

(Now I should plug Mike Girvin's book.)
 
Upvote 0
Hello,

Thanks for the reply. However, the formula does not work properly because it does not always return the correct sales value... :(

Any idea what I might be doing wrong?

This?

Excel 2010
ABCDEFGH
ProductWarehouseStockProductSalesWarehouse
AA
BA
AB
B

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: right"][/TD]

[TD="align: right"][/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]123[/TD]

[TD="align: right"]100[/TD]
[TD="align: right"][/TD]
[TD="align: right"]123[/TD]
[TD="align: right"]70[/TD]

[TD="align: right"]100[/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]123[/TD]

[TD="align: right"]150[/TD]
[TD="align: right"][/TD]
[TD="align: right"]1234[/TD]
[TD="align: right"]25[/TD]

[TD="align: right"]50[/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]1234[/TD]

[TD="align: right"]50[/TD]
[TD="align: right"][/TD]
[TD="align: right"]1234[/TD]
[TD="align: right"]150[/TD]

[TD="align: right"]200[/TD]

[TD="align: center"]5[/TD]
[TD="align: right"]1234[/TD]

[TD="align: right"]200[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet10

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]H2[/TH]
[TD="align: left"]{=INDEX($C$2:$C$5,MATCH(E2&G2,$A$2:$A$5&$B$2:$B$5,0))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Glad you got it to work but as you see the formula above returned all three matches, or did you want something different?
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top