Lookup formula returning multiple Columns based on 2 criteria

SteynBS

Board Regular
Joined
Jun 27, 2022
Messages
104
Office Version
  1. 365
Platform
  1. Windows
Hi Guys,

I think I am just missing something with my formula.

In table 1 (sheet3) I have a table with my code in Column B and different sizes with its values from Column D through H

1665033085504.png

In Table 3 (Sheet1) I have a table where I need to match the code and the size to return the value from that size column

1665033221626.png


So if I have a code in table 3 with a small size, I need it to return the value from the corresponding code in Table1 but the value in the Small column, if the same code has a Large size I need it to return the value from the Large column

The formulas I tried to use:
=INDEX(Table1[[XS]:[XL]],MATCH(1,(Table1[[#All],[Article]]=[@Article])*(Table1[[#Headers],[XS]:[XL]]=[@Size]),0))
=XLOOKUP(1,([@Article]=Table1[Article])*([@Size]=Table1[[#All],[XS]:[XL]]),Table1[[XS]:[XL]])


Any suggestions or help, please?
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Have you tried like this?

Excel Formula:
=INDEX(Table1[#All],MATCH([@Article],Table1[[#All],[Article]],0),MATCH([@Size],Table1[#Headers],0))
 
Upvote 0
Solution
Hi Guys,

I think I am just missing something with my formula.

In table 1 (sheet3) I have a table with my code in Column B and different sizes with its values from Column D through H

View attachment 75558
In Table 3 (Sheet1) I have a table where I need to match the code and the size to return the value from that size column

View attachment 75559

So if I have a code in table 3 with a small size, I need it to return the value from the corresponding code in Table1 but the value in the Small column, if the same code has a Large size I need it to return the value from the Large column

The formulas I tried to use:
=INDEX(Table1[[XS]:[XL]],MATCH(1,(Table1[[#All],[Article]]=[@Article])*(Table1[[#Headers],[XS]:[XL]]=[@Size]),0))
=XLOOKUP(1,([@Article]=Table1[Article])*([@Size]=Table1[[#All],[XS]:[XL]]),Table1[[XS]:[XL]])


Any suggestions or help, please?

How about below?

Excel Formula:
=INDEX(Table1[#All],MATCH([@Article],Table1[[#All],[Article]],0),MATCH([@Size],Table1[#Headers],0))

/Skovgaard
 
Upvote 0
Have you tried like this?

Excel Formula:
=INDEX(Table1[#All],MATCH([@Article],Table1[[#All],[Article]],0),MATCH([@Size],Table1[#Headers],0))

Thank you, it works - Thank you for your time and assistance
 
Upvote 0
How about below?

Excel Formula:
=INDEX(Table1[#All],MATCH([@Article],Table1[[#All],[Article]],0),MATCH([@Size],Table1[#Headers],0))

/Skovgaard
It works perfect, thank you for your asssitance
 
Upvote 0
You could also do it like this
Excel Formula:
=XLOOKUP([@Article],Table1[Article],INDIRECT("Table1["&[@Size]&"]"))
 
Upvote 0

Forum statistics

Threads
1,215,829
Messages
6,127,127
Members
449,361
Latest member
VBquery757

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