INDEX and MATCH with multiple criteria BUT one of those criteria can change based on another formula

Mulb90

New Member
Joined
Mar 31, 2022
Messages
4
Office Version
  1. 2010
Platform
  1. Windows
I need a way to look up multiple criteria in a table. Which I can usually do no problem with the below type formula

=IFERROR(INDEX(Table1[PriceA],MATCH(L6&L7,Table1[Item]&Table1[Size],0)),0)

However I need one of the table header look ups (PriceA) to change depending on a result from another Cell (L8). So depending on the answer in L8 could be PriceA or PriceB or PriceC, but putting L8 in the forumla as a header look up doesn't work. (please note this is just a simplified example as my spreadsheet is much larger and contains sensitive data)


Book1
ABCDEFGHIJKLMNOPQRS
1
2
3
4
5ItemSizePriceAPriceBPriceC
6Hoodiesmall171419ItemT-shirt
7Hoodiemedium191621SizeSmall
8Hoodielarge181520BrisbanePriceA
9T-Shirtsmall201722Cost=IFERROR(INDEX(Table1[L9],MATCH(L6&L7,Table1[Item]&Table1[Size],0)),0)
10T-shirtmedium161318
11T-shirtlarge151217
12T-shirtx-large211823
13
14
15
16BrisbanePriceA
17SydneyPriceB
18PerthPriceA
19CairnsPriceA
20DarwinPriceB
21TasmaniaPriceB
Sheet1
Cell Formulas
RangeFormula
L8L8=IF(K8="Brisbane","PriceA","PriceB")
Cells with Data Validation
CellAllowCriteria
K8List=$D$16:$D$21
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Maybe a bit of indirect action:
Excel Formula:
=IFERROR(INDEX(INDIRECT("Table1[" & L8 & "]"),MATCH(L6&L7,Table1[Item]&Table1[Size],0)),0)
 
Upvote 0
Another option
Excel Formula:
=IFERROR(INDEX(Table1,MATCH(L6&L7,Table1[Item]&Table1[Size],0),MATCH(L8,Table1[#Headers],0)),0)
 
Upvote 0
Solution

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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