Match on two criteria

Ibrarbutt

New Member
Joined
Jul 23, 2015
Messages
30
I want to match Hotel Name, then Room Type, if matching then bring the rate from Table 1 to table 2


Table 1

Hotel Name - Room Type - Rate


Royal Hotel - Single - 120
Priceless Hotel - Twin - 140
Royal Hotel - Twin (BB) - 145
.
.
.
.
.
.



Table 2

If I select

Hotel Name - Room Type - Rate

Royal Hotel - Single - (this rate will bring from table 1)
 
Last edited:

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Is the data in three different columns ?
 
Upvote 0
yes
it is three different columns

Table 1


Hotel Name
Room Type
Rate
Royal Hotel <strike></strike>
Single
120
Prince Hotel
Twin
135
Royal Hotel <strike></strike>
Triple
145
Ezdan
Single
160
Royal Hotel <strike></strike>
Single (BB)
165

<tbody>
</tbody>














Table 2

Hotel Name
Room Type
Rate
Royal Hotel <strike></strike>
Single
from table 1
Royal Hotel <strike></strike><strike></strike>
Twin
from table 1<strike></strike>
Ezdan
Triple
from table 1<strike></strike>

<tbody>
</tbody>
 
Upvote 0
Hotel Name Room Type Rate
Royal Hotel Single 120
Prince Hotel Twin 135
Royal Hotel Triple 145
Ezdan Single 160
Royal Hotel Single (BB) 165

Hotel Name Room Type Rate
Royal Hotel Single 120
Royal Hotel Twin #N/A
Ezdan Triple #N/A


rate:
=INDEX(A$2:C$6,MATCH(1,(A$2:A$6=A9)*(B$2:B$6=B9),0),3)
ctrl + shift+enter
copy down

this information copy paste in excel
and view better
 
Upvote 0
A
B
C
1
Hotel NameRoom TypeRate
2
Royal HotelSingle
120​
3
Prince HotelTwin
135​
4
Royal HotelTriple
145​
5
EzdanSingle
160​
6
Royal HotelSingle (BB)
165​
7
8
9
10
11
12
13
14
Hotel NameRoom TypeRate
15
Royal HotelSingle
120​
16
Royal HotelTwinno match
17
EzdanTripleno match

<tbody>
</tbody>


c15=
IF(SUMIFS($C$2:$C$6,$A$2:$A$6,A15,$B$2:$B$6,B15)=0,"no match",SUMIFS($C$2:$C$6,$A$2:$A$6,A15,$B$2:$B$6,B15)) copy down

 
Upvote 0
Select the hotel cells of Table 1 and name the selection hotel,
Select the cells of room type of Table 1 and name the selection roomtype.
Select the cells housing rates of Table 1 and name the selection rate.

Let A:C of a different sheet house Table 2.

In C2 of this sheet, control+shift+enter, not just enter, and copy down:

=IFNA(INDEX(rate,MATCH(B2,IF(hotel=A2,roomtype),0)),"not available")

If you get a #NAME ? error, replace IFNA with IFERROR and apply control+shift+enter.
 
Upvote 0
Suppose your table 1 range B2:D7 and table 2 range B9:D14 with rows 2 and 9 are headers, enter this formula in D10 and drag it down: "=INDEX($D$3:$D$7,MATCH(B10:B10&C10:C10,$B$3:$B$7&$C$3:$C$7,0),)" ctrl + shift + enter.
 
Upvote 0

Forum statistics

Threads
1,215,377
Messages
6,124,598
Members
449,174
Latest member
chandan4057

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