How to lookup text with multi criteria (in Excel 2019)

Sochen

Board Regular
Joined
Dec 6, 2022
Messages
66
Office Version
  1. 2021
Platform
  1. Windows
Hi All,

How to lookup "location" in yellow highlight below with 3 criteria which include "Week", "Department", "Categories":

Book2
ABCDEFGHIJKL
1
2
3Week1234Criteria 1Criteria 2Criteria 3
4Smart PhoneWeekLocationDepartmentCategories
5Table 1iPhoneVivoLGSamsung1Table 1Smart PhoneiPhone
6Table 2NokiaiPhoneSamsungiPhone1Table 1Smart PhoneiPhone
7Table 3SamsungSamsungiPhoneNokia1Table 3Smart PhoneSamsung
8Laptop1Table 2Smart PhoneNokia
9Table 1DellHPASUSDell2Table 2Smart PhoneiPhone
10Table 2HPDellHPHP2Table 1Smart PhoneVivo
11Table 3ACERACERDellACER2Table 3Smart PhoneSamsung
122Table 1Smart PhoneVivo
133Table 1Smart PhoneLG
143Table 3Smart PhoneiPhone
154Table 2Smart PhoneiPhone
164Table 2Smart PhoneiPhone
174Table 1Smart PhoneSamsung
184Table 2Smart PhoneiPhone
19
Sheet1
 
Here is an XLookup version:
Excel Formula:
=XLOOKUP(1,
      ($A$4:$A$9=J5)*(XLOOKUP(H5,$A$3:$F$3,$A$4:$F$9)=K5),
       $B$4:$B$9,
       "")

Here is an XLookup with Index Match instead of a 2nd XLookup
Excel Formula:
=XLOOKUP(1,
      ($A$4:$A$9=J5)*(INDEX($A$4:$F$9,0,MATCH(H5,$A$3:$F$3,0))=K5),
       $B$4:$B$9,
        "" )

And the filter option:
Excel Formula:
=LET(fltrWk, FILTER( $C$4:$F$9, $C$3:$F$3=H5 ),
          FILTER( $B$4:$B$9, ($A$4:$A$9=J5) * (fltrWk=K5), "" ) )
 
Upvote 0

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Here is an XLookup version:
Excel Formula:
=XLOOKUP(1,
      ($A$4:$A$9=J5)*(XLOOKUP(H5,$A$3:$F$3,$A$4:$F$9)=K5),
       $B$4:$B$9,
       "")

Here is an XLookup with Index Match instead of a 2nd XLookup
Excel Formula:
=XLOOKUP(1,
      ($A$4:$A$9=J5)*(INDEX($A$4:$F$9,0,MATCH(H5,$A$3:$F$3,0))=K5),
       $B$4:$B$9,
        "" )

And the filter option:
Excel Formula:
=LET(fltrWk, FILTER( $C$4:$F$9, $C$3:$F$3=H5 ),
          FILTER( $B$4:$B$9, ($A$4:$A$9=J5) * (fltrWk=K5), "" ) )
Hello Sir,

It works perfectly.
Thank you so much for sharing.
Have a great day!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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