Vlookup multiple Criterias

virtech2k3

New Member
Joined
Jun 28, 2011
Messages
6
Column A B C D E F
Price Type Rooms Price Rooms
123000 Family 4 124000 3
121000 Family 3 121000 2
125000 Condo 1 123000 3
121000 Dorm 1 121000 2
126000 Dorm 2 125000 1
124000 Family 3 124000 4
125000 Condo 2 126000 1

Can someone please help?

I want to do a Vlookup formula above. I want to find all houses Priced $125000 (Column E), but that also has 1 ROOM (Column C) and return the HOUSE type. (B)

In other words, I want excel to return the HOUSE TYPE (column B above) priced $125000, only if the ROOM (Row F ) corresponds to column C.

In the Above Example, Excel should give me Type (CONDO) because it has 1 room and $1250000 price (perfect multiple match)

Please let me know if you need more information as I am rather new at this.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
The data hasn't come out to clearly I don't think..... i show two Prices and two room counts.

Column E isn't Price its the Second Room count.

Could you explain?
 
Upvote 0
The data hasn't come out to clearly I don't think..... i show two Prices and two room counts.

Column E isn't Price its the Second Room count.

Could you explain?

Sorry about that.

Column A= Price(1st) B=Type C=Rooms(1st) D=Price(2nd) E=Rooms(2nd) F=Wants the returned Type from Column B only if Price 2nd and rooms 2nd match price 1st and rooms 1st.

Please let me know if this clears up more and thanks for your help.
 
Upvote 0
This may not be the cleanest solution but it works. Add a blank col at the start and combine the Price 1 and Rooms 1

Then use the below formula to get what you want in Col G

*Helper col A formula
=B2&D2

** Col G Formula
=IF(ISNA(VLOOKUP(E2&F2,$A$2:$D$8,3,FALSE))=TRUE,"",VLOOKUP(E2&F2,$A$2:$D$8,3,FALSE))



<table border = "1" cellspacing = "0" bordercolor="#999999">
<tr><td bgcolor="#C0C0C0"> </td>
<td align="center" bgcolor="#C0C0C0"><b>A</b></td><td align="center" bgcolor="#C0C0C0"><b>B</b></td><td align="center" bgcolor="#C0C0C0"><b>C</b></td><td align="center" bgcolor="#C0C0C0"><b>D</b></td><td align="center" bgcolor="#C0C0C0"><b>E</b></td><td align="center" bgcolor="#C0C0C0"><b>F</b></td><td align="center" bgcolor="#C0C0C0"><b>G</b></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>1</b></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Helper </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Price </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Type </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Rooms </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Price </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Rooms </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000"> </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>2</b></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=B2&D2 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">123000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Family </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">4 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">124000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">3 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=IF(ISNA(VLOOKUP(E2&F2,$A$2:$D$8,3,FALSE))=TRUE,"",VLOOKUP(E2&F2,$A$2:$D$8,3,FALSE)) </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>3</b></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=B3&D3 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">121000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Family </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">3 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">121000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">2 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=IF(ISNA(VLOOKUP(E3&F3,$A$2:$D$8,3,FALSE))=TRUE,"",VLOOKUP(E3&F3,$A$2:$D$8,3,FALSE)) </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>4</b></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=B4&D4 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">125000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Condo </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">1 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">123000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">3 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=IF(ISNA(VLOOKUP(E4&F4,$A$2:$D$8,3,FALSE))=TRUE,"",VLOOKUP(E4&F4,$A$2:$D$8,3,FALSE)) </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>5</b></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=B5&D5 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">121000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Dorm </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">1 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">121000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">2 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=IF(ISNA(VLOOKUP(E5&F5,$A$2:$D$8,3,FALSE))=TRUE,"",VLOOKUP(E5&F5,$A$2:$D$8,3,FALSE)) </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>6</b></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=B6&D6 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">126000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Dorm </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">2 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">125000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">1 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=IF(ISNA(VLOOKUP(E6&F6,$A$2:$D$8,3,FALSE))=TRUE,"",VLOOKUP(E6&F6,$A$2:$D$8,3,FALSE)) </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>7</b></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=B7&D7 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">124000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Family </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">3 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">124000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">4 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=IF(ISNA(VLOOKUP(E7&F7,$A$2:$D$8,3,FALSE))=TRUE,"",VLOOKUP(E7&F7,$A$2:$D$8,3,FALSE)) </font></td></tr>
<tr><td align = "center" bgcolor="#C0C0C0"><b>8</b></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=B8&D8 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">125000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">Condo </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">2 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">126000 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "right" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">1 </font></td><td rowspan="1" colspan="1" width="192" height="30" align = "left" valign = "bottom" bgcolor ="#FFFFFF"><font color="#000000">=IF(ISNA(VLOOKUP(E8&F8,$A$2:$D$8,3,FALSE))=TRUE,"",VLOOKUP(E8&F8,$A$2:$D$8,3,FALSE)) </font></td></tr>
</table>
 
Upvote 0
Shadow,

This works perfectly with this data and thank you for your precise advice.

My question though goes outside the scope of this data and I tried to use it as example. What I am ultimate trying to do is compare two sets of data when they match perfectly, I thought this quick example would help and it does for this particular item.

But I guess my MAIN question is, is there a way to do a VLOOKUP for say 5 columns, only when the other set of data matches the 5 columns perfectly?

The report I am working with comes from 2 different databases and I only need the ones where 5 different sets of columns from one report, match the exact same 5 sets on the other report.

It gets complicated as it contains over 40 columns and 500 rows of data, so I was trying to get a set method from this small example and just expanding to my massive report.
 
Upvote 0
You can combine as many cols as you want in your helper col and then just modify the Vlookup to look for matching cols in the second file.

For example
*Helper col A formula
=B2&D2&F2&G2

** Col G Formula
=IF(ISNA(VLOOKUP(B2&D2&F2&G2,$A$2:$D$8,3,FALSE))=TRUE,"",VLOOKUP(B2&D2&F2&G2,$A$2:$D$8,3,FALSE))
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,424
Members
452,914
Latest member
echoix

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