How to VLookup on multiple criteria?

gorgon777

Board Regular
Joined
Mar 12, 2012
Messages
58
Hi,

I have the below two tables in two separate worksheets:

POSummary
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Date[/TD]
[TD]PO[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]01.01.2011[/TD]
[TD]10987[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]01.02.2011[/TD]
[TD]10987[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]01.03.2011[/TD]
[TD]10987[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]








KRANData
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Date[/TD]
[TD]PO[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]01.12.2010[/TD]
[TD]10987[/TD]
[TD]UK[/TD]
[/TR]
[TR]
[TD]01.01.2011[/TD]
[TD]10987[/TD]
[TD]USA[/TD]
[/TR]
[TR]
[TD]01.02.2011[/TD]
[TD]10987[/TD]
[TD]SA[/TD]
[/TR]
[TR]
[TD]01.03.2011[/TD]
[TD]10987[/TD]
[TD]AUS[/TD]
[/TR]
</tbody>[/TABLE]










What I would like to do is lookup the 'Name' from the KRANData table by using the 'Date' and 'PO' values within the POSummary table. For example, the 'Name' value in the first row of the POSummary table should be USA and the second row should be SA.

How can i achieve this?

With Thanks
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
try this
Excel Workbook
ABC
1DatePOName
201.12.201010987UK
301.01.201110987USA
401.02.201110987SA
501.03.201110987AUS
Sheet2
Excel 2010
Excel Workbook
ABC
1DatePOName
201.01.201110987USA
301.02.201110987SA
401.03.201110987AUS
Sheet1
Excel 2010
#VALUE!
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
 
Upvote 0
Hi, Thanks for writing!!

I have your table POSummary at A1:C4 and the table KRANData at F1:H5

In C2 (the Name Column of the POSummary table you can use this formula:

=INDEX($H$2:$H$5,SUMPRODUCT(($F$2:$F$5=A2)*($G$2:$G$5=B2)*(ROW($F$2:$F$5)-ROW($F$2)+1)))

Drag the formula down.

Hope this helps!

Thanks/Raj
 
Upvote 0
Hi, Thanks for writing!!

I have your table POSummary at A1:C4 and the table KRANData at F1:H5

In C2 (the Name Column of the POSummary table you can use this formula:

=INDEX($H$2:$H$5,SUMPRODUCT(($F$2:$F$5=A2)*($G$2:$G$5=B2)*(ROW($F$2:$F$5)-ROW($F$2)+1)))

Drag the formula down.

Hope this helps!

Thanks/Raj
Thank you both Raj and Sanv, both solutions have worked great!!
 
Upvote 0
Since column B in both tables have similar contents you would also use a simple vlookup formula. Click onthe first cell of the first row in the POSummary table then insert vlookup formula from formula bar. Function argument box will appear.In the lookup value click 01.01.2011 of the first row, second column of the POSummary table. In the table array field select values in the KRAData table. Fix both values as follows, =VLOOKUP(A2,Sheet2!$A$3:$C$6,3) then double click on the right of the box in the first row of the column where you inserted formula. You will get those result as you wanted

I hope this can be another alternative
 
Last edited:
Upvote 0
Hi, Thanks for writing!!

I have your table POSummary at A1:C4 and the table KRANData at F1:H5

In C2 (the Name Column of the POSummary table you can use this formula:

=INDEX($H$2:$H$5,SUMPRODUCT(($F$2:$F$5=A2)*($G$2:$G$5=B2)*(ROW($F$2:$F$5)-ROW($F$2)+1)))

Drag the formula down.

Hope this helps!

Thanks/Raj


A dangerous formula, if there is more than one match
 
Upvote 0

Forum statistics

Threads
1,223,272
Messages
6,171,112
Members
452,381
Latest member
Nova88

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