Index and Match with multiple criterias

pingvin

New Member
Joined
Oct 28, 2017
Messages
15
Hi,
I have a problem with a Index and Match formula with multiple criteria (array formula).
I have tried two different versions but neither of them work, could anybody please have a look at this? I have also uploaded the file to my dropbox if you want to see the real file.

Version 1: {=INDEX('Allergy & Calories'!$A$10:$I$15,MATCH($C9&M$7,'Allergy & Calories'!$A$10:$A$15&'Allergy & Calories'!$C$10:$C$15,0))}
Version 2: {=INDEX('Allergy & Calories'!$C$10:$I$15,MATCH(1,('Allergy & Calories'!$A$10:$A$15=$C$9)*('Allergy & Calories'!$C$10:$I$15=N$7),0))}

I want the have the value from cell $C$10:$I$15 on the "Allergy & Calories worksheet" into cell $M$9:$S$23 on the "6 short Recipes sheet".
But only if the criteria matches the item code in cells $C$9:$C$23 and the names in cells $M$7:$S$7 on the "6 short Recipes sheet".

https://www.dropbox.com/s/izaqxtmm52tk1gp/array formula (test).xlsx?dl=0
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
In M9 enter, copy across, and down:

=IFERROR(INDEX('Allergy & Calories'!$C$11:$I$15,MATCH($C9,'Allergy & Calories'!$A$11:$A$15,0),MATCH("*"&M$7&"*",'Allergy & Calories'!$C$10:$I$10,0)),"")
 
Upvote 0
Hi!

Try the Array Formula below in M9 and copy down and to the right.

Use Ctrl+Shift+Enter to enter the formula.

=VLOOKUP($E9,IF('Alergy & Calories'!$A$2:$A$6=$C9,'Alergy & Calories'!$B$2:$I$6),MATCH(M$7,'Alergy & Calories'!$B$1:$I$1,0),0)


ABCDEFGHIJKLMNOPQRST
7Allergen EggAllergen MilkAllergen WheatAllergen BuckwheatAllergen PeanutsAllergen Shrimp / prawnAllergen Crab
8Item CodeSupplierItemUnitStd.CostQTY (g)Act QtyAct CostEnergyStat
9150012Sauce CurryNoYesYesNoNoNoNo
10260010CandyTraces ofYesNoNoNoNoNo
11340013Milk Long LifeNoYesNoNoNoNoNo
12430011RiceNoNoNoNoNoNoNo
13520014BreadTraces ofTraces ofYesNoNoNoNo
146
157
168
179
1810
1911
2012
2113
2214
2315
24
*************************************************************************************************************************************************************

<tbody>
</tbody>

Markmzz
 
Last edited:
Upvote 0
Thanks for the help guys!
Is there also possible have the values in $M$9:$S$9 changed?
Instead of showing "No", to have it show ":"
Instead of showing "Yes", to have it show "X"
Instead of showing "Traces of", to have it show "T"
Is this possible by applying conditional formatting to cell $M$9:$S$9
 
Upvote 0
Thanks for the help guys!
Is there also possible have the values in $M$9:$S$9 changed?
Instead of showing "No", to have it show ":"
Instead of showing "Yes", to have it show "X"
Instead of showing "Traces of", to have it show "T"
Is this possible by applying conditional formatting to cell $M$9:$S$9

Why not? These are user entries. If you change them, the formula will invariably use them.

If you don't want to change the user entries, but require the corresponding new values...

In M9 enter, copy across, and down:

=IFERROR(VLOOKUP(INDEX('Allergy & Calories'!$C$11:$I$15,MATCH($C9,'Allergy & Calories'!$A$11:$A$15,0),MATCH("*"&M$7&"*",'Allergy & Calories'!$C$10:$I$10,0)),{"no",":";"yes","X";"traces of","T"},2,0),"")
 
Upvote 0
Thanks for the help guys!
Is there also possible have the values in $M$9:$S$9 changed?
Instead of showing "No", to have it show ":"
Instead of showing "Yes", to have it show "X"
Instead of showing "Traces of", to have it show "T"
Is this possible by applying conditional formatting to cell $M$9:$S$9

Hi Pingvin,

Lets go:

1) In this case, try this:

=VLOOKUP(VLOOKUP($E9,IF('Alergy & Calories'!$A$2:$A$6=$C9,'Alergy & Calories'!$B$2:$I$6),MATCH(M$7,'Alergy & Calories'!$B$1:$J$1,0),0),
{"No",":";"Yes","X";"Traces of","T"},2,0)


or

=LOOKUP(VLOOKUP($E9,IF('Alergy & Calories'!$A$2:$A$6=$C9,'Alergy & Calories'!$B$2:$I$6),MATCH(M$7,'Alergy & Calories'!$B$1:$J$1,0),0),
{"No",":";"Traces of","T";"Yes","X"})


2) Yes, is possible. What conditional formatting do you want? What rules?

Markmzz
 
Upvote 0
=LOOKUP(VLOOKUP($E9,IF('Alergy & Calories'!$A$2:$A$6=$C9,'Alergy & Calories'!$B$2:$I$6),MATCH(M$7,'Alergy & Calories'!$B$1:$J$1,0),0),
{"No",":";"Traces of","T";"Yes","X"})

Hi again!

I think that the second Array Formula of my previous post, isn't ok.

Instead, try this:

Use Ctrl+Shift+Enter to enter the formula

=LOOKUP(1,1/({"No";"Traces of";"Yes"}=VLOOKUP($E9,IF('Alergy & Calories'!$A$2:$A$6=$C9,
'Alergy & Calories'!$B$2:$I$6),MATCH(M$7,'Alergy & Calories'!$B$1:$J$1,0),0)),{":";"T";"X"})


Markmzz
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,698
Members
448,979
Latest member
DET4492

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