Lookup multiple criteria

Joey_Ng

New Member
Joined
Mar 7, 2020
Messages
25
Office Version
  1. 365
Platform
  1. Windows
Hello Experts,

Needing your help please with lookup using multiple criteria's:


The above link has the workbook. I am trying to look up the values for each of the cells in B2:E4 for sheets "Cat B" and "Cat C" looking up values in "Sheet1" using the 3 criterias: category, week number & type. Please help with:
1) what's the best formula to look up those 3 criterias in the workbook? Can you help with the formula answer?
2) can you help with how to best combine "sheetname + substitute formula + match formula" into a cell address?

My workings below:


WorkingValueFormula
row number for Cat B >4=MATCH(A1,Sheet1!A:A,0)
Column letter for wk1 (weeknumber) >B=SUBSTITUTE(ADDRESS(1,MATCH(B1,Sheet1!1:1,0),4),"1","")
Adding 2 to the above (address) formula to get the end section. That is each week always have 3 columns containing hat, shirt & shoe >D=SUBSTITUTE(ADDRESS(1,(MATCH(B1,Sheet1!1:1,0)+2),4),"1","")
knowing above I could use Xlookup to return 457 >
but I want to include the formulas for the moving columns for the week numbers
457=XLOOKUP(A2,Sheet1!B2:D2,Sheet1!B4:D4,,0)
I tried the formula on the right but couldn't get the filename right using CONCAT. Not sure how to incoporate sheetname+substitute formula + match formula) as a cell address=XLOOKUP(A2,CONCAT("Sheet1!",SUBSTITUTE(ADDRESS(1,MATCH(B1,Sheet1!1:1,0),4),"1",""),2):CONCAT("Sheet1!",SUBSTITUTE(ADDRESS(1,(MATCH(B1,Sheet1!1:1,0)+2),4),"1",""),4),"1",""),2),CONCAT("Sheet1!",SUBSTITUTE(ADDRESS(1,MATCH(B1,Sheet1!1:1,0),4),"1",""),MATCH(A1,Sheet1!A:A,0)):CONCAT("Sheet1!",SUBSTITUTE(ADDRESS(1,(MATCH(B1,Sheet1!1:1,0)+2),4),"1",""),4),"1",""),MATCH(A1,Sheet1!A:A,0)),,0)

Thank You,

Joey
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Maybe the following does help:

Book1
ABCDEFGHIJKLM
1Wk1Wk2Wk3Wk4
2Categoryhatshirtshoehatshirtshoehatshirtshoehatshirtshoe
3A567119839559338356248291195239661697
4B457477579559425781341176994376880297
5C2716077584601111000738404247180566603
6D911149794887892708495525626945853711
7
8BWk1wk2wk3wk4
9Hat457559341376
10Shirt477425176880
11Shoe579781994297
Sheet6
Cell Formulas
RangeFormula
B9:E11B9=INDEX(FILTER(FILTER($B$3:$M$6,$A$3:$A$6=$A$8),$B$2:$M$2=$A9),MATCH(B$8,TOROW($1:$1,1),0))
 
Last edited:
Upvote 0
Here is a version you want to have it on separate sheets. Had to cheat a little, by putting Wk1 in the three columns( this can be "disguised" by using white text)
Book1.xlsx
ABCDEFGHIJKLM
1Wk1Wk1Wk1Wk2Wk2Wk2Wk3Wk3Wk3Wk4Wk4Wk4
2Categoryhatshirtshoehatshirtshoehatshirtshoehatshirtshoe
3A567119839559338356248291195239661697
4B457477579559425781341176994376880297
5C2716077584601111000738404247180566603
6D911149794887892708495525626945853711
Sheet1


and the below is on the Cat B Sheet
Book1.xlsx
ABCDE
1BWk1wk2wk3wk4
2Hat457559341376
3Shirt477425176880
4Shoe579781994297
Cat B
Cell Formulas
RangeFormula
B2:E4B2=INDEX(Sheet1!$B$3:$M$6,MATCH($A$1,Sheet1!$A$3:$A$6,0),MATCH(B$1&$A2,Sheet1!$B$1:$M$1&Sheet1!$B$2:$M$2,0))
 
Upvote 0
Thanks JvdV and Skybluekid. The answers doesn't seem to work. Please note below:
1) The lookup sheets (Cat B & cat C) has its own sheets (ie, cannot add to the reference "Sheet1")
2) the reference Sheet1 is a weekly extract so cannot make changes to it. Also, for example B1:D1 (wk1 section) is merged cells so cannot manually unmerge for each section.
Any further help would be much appreciated.

Many Thanks,

Joey
 
Upvote 0
Hi, try the below
Book1.xlsx
GHIJK
2BWk1Wk2Wk3Wk4
3Hat457559341376
4Shirt477425176880
5Shoe579781994297
Cat B
Cell Formulas
RangeFormula
H3:K5H3=INDEX(OFFSET(Sheet1!$A$3,,MATCH(H$2,Sheet1!$B$1:$M$1,0),4,3),MATCH($A$1,Sheet1!$A$3:$A$6,0),MATCH($A2,Sheet1!$B$2:$D$2,0))
 
Upvote 0
Solution

Forum statistics

Threads
1,214,982
Messages
6,122,575
Members
449,089
Latest member
Motoracer88

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