Index Match, 1 match and 1 contains certain text

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
929
Office Version
  1. 365
Platform
  1. Windows
I need help with an Index Match formula. I am looking to return whatever is in column C as long as 2 criteria is met:
1. There is an exact match between E2 and Column A
2. Column B contains the word in F1 - (I would prefer a cell reference to F1 rather than typing in the text *Blue*)

Below is an example and an incorrect formula that is not returning the results I am looking for. The desired results are below in yellow

Book1
ABCDEFGHI
1NameItemIndex HelperBlueGreenYellowRed
2TomHappy Blue birdYTomN
3Gregmedium Green plantYGregN
4Willsmall yellow butterflyYWillN
5Marklarge red berryYMarkN
6
7Desired Results:
8BlueGreenYellowRed
9TomYNNN
10GregNYNN
11WillNNYN
12MarkNNNY
Sheet1
Cell Formulas
RangeFormula
F2:F5F2=IFERROR(INDEX($C$2:$C$5,MATCH(1,("*Blue*"=$B$2:$B$5)*(E2=$A$2:$A$5),FALSE)),"N")


Thank you to anyone who can assist me with this!
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
If the order of your name columns will be the same, you could just use this

Book1
ABCDEFGH
1NameItemBlueGreenYellowRed
2TomHappy Blue birdTomYNNN
3Gregmedium Green plantGregNYNN
4Willsmall yellow butterflyWillNNYN
5Marklarge red berryMarkNNNY
Sheet1
Cell Formulas
RangeFormula
E2:H5E2=IF(ISNUMBER(SEARCH(E1:H1,B2:B5)),"Y","N")
Dynamic array formulas.
 
Upvote 0
If the order of your name columns will be the same, you could just use this

Book1
ABCDEFGH
1NameItemBlueGreenYellowRed
2TomHappy Blue birdTomYNNN
3Gregmedium Green plantGregNYNN
4Willsmall yellow butterflyWillNNYN
5Marklarge red berryMarkNNNY
Sheet1
Cell Formulas
RangeFormula
E2:H5E2=IF(ISNUMBER(SEARCH(E1:H1,B2:B5)),"Y","N")
Dynamic array formulas.
This does not account for the Names...

If I move a name the data is now incorrect. I need to account for the names (Column E) and F1:I1 changing.
Note: On the original spreadsheet column E and F1:I1 data changes due to Unique formulas.

Index match containing certain text and exact match.xlsm
ABCDEFGHI
1NameItemIndex HelperBlueGreenYellowRed
2TomHappy Blue birdYWillYNNN
3Gregmedium Green plantYGregNYNN
4Willsmall yellow butterflyYTomNNYN
5Marklarge red berryYMarkNNNY
Sheet1
Cell Formulas
RangeFormula
F2:I5F2=IF(ISNUMBER(SEARCH(F1:I1,B2:B5)),"Y","N")
Dynamic array formulas.
 
Upvote 0
Maybe:


Book1
ABCDEFGHI
1NameItemIndex HelperBlueGreenYellowRed
2TomHappy Blue birdYTomYNNN
3Gregmedium Green plantYGregNYNN
4Willsmall yellow butterflyYWillNNYN
5Marklarge red berryYMarkNNNY
Sheet4
Cell Formulas
RangeFormula
F2:I5F2=IF(COUNTIFS($A$2:$A$5,$E2,$B$2:$B$5,"*"&F$1&"*"),"Y","N")



Or with a spill formula, which might be preferable if you want to use the F1# reference for a UNIQUE formula:

Book1
EFGHI
1BlueGreenYellowRed
2TomYNNN
3GregNYNN
4WillNNYN
5MarkNNNY
Sheet4
Cell Formulas
RangeFormula
F2:I5F2=IF(COUNTIFS(A2:A5,E2:E5,B2:B5,"*"&F1:I1&"*"),"Y","N")
Dynamic array formulas.
 
Upvote 0
Solution
Another option, if your Index Helpers are not going to be as simple as "Y" for all names:
2024-07-22.xlsx
ABCDEFGHI
1NameItemIndex HelperBlueGreenYellowRed
2TomHappy Blue birdaTomaNNN
3Gregmedium Green plantbGregNbNN
4Willsmall yellow butterflycWillNNcN
5Marklarge red berrydMarkNNNd
6SallyNNNN
Sheet2
Cell Formulas
RangeFormula
F2:I6F2=IFERROR(IF(ISNUMBER(SEARCH(F$1,$B2)),INDEX($A$2:$C$5,MATCH($E2,$A$2:$A$5,0),3),"N"),"n")
 
Upvote 0
Here a dynamic formula

Book1
ABCDEFGH
1NameItemBlueGreenYellowRed
2TomHappy Blue birdWillNNYN
3Gregmedium Green plantGregNYNN
4Willsmall yellow butterflyTomYNNN
5Marklarge red berryMarkNNNY
Sheet1
Cell Formulas
RangeFormula
E2:H5E2=IF(ISNUMBER(SEARCH(E1:H1,INDEX(B2:B5,XMATCH(D2:D5,A2:A5)))),"Y","N")
Dynamic array formulas.
 
Upvote 0
Another option, if your Index Helpers are not going to be as simple as "Y" for all names:
2024-07-22.xlsx
ABCDEFGHI
1NameItemIndex HelperBlueGreenYellowRed
2TomHappy Blue birdaTomaNNN
3Gregmedium Green plantbGregNbNN
4Willsmall yellow butterflycWillNNcN
5Marklarge red berrydMarkNNNd
6SallyNNNN
Sheet2
Cell Formulas
RangeFormula
F2:I6F2=IFERROR(IF(ISNUMBER(SEARCH(F$1,$B2)),INDEX($A$2:$C$5,MATCH($E2,$A$2:$A$5,0),3),"N"),"n")
You probably don't need the "iferror" part of my formula; I just had it there to distinguish errors from non-matches.
 
Upvote 0
Maybe:


Book1
ABCDEFGHI
1NameItemIndex HelperBlueGreenYellowRed
2TomHappy Blue birdYTomYNNN
3Gregmedium Green plantYGregNYNN
4Willsmall yellow butterflyYWillNNYN
5Marklarge red berryYMarkNNNY
Sheet4
Cell Formulas
RangeFormula
F2:I5F2=IF(COUNTIFS($A$2:$A$5,$E2,$B$2:$B$5,"*"&F$1&"*"),"Y","N")



Or with a spill formula, which might be preferable if you want to use the F1# reference for a UNIQUE formula:

Book1
EFGHI
1BlueGreenYellowRed
2TomYNNN
3GregNYNN
4WillNNYN
5MarkNNNY
Sheet4
Cell Formulas
RangeFormula
F2:I5F2=IF(COUNTIFS(A2:A5,E2:E5,B2:B5,"*"&F1:I1&"*"),"Y","N")
Dynamic array formulas.
This is perfect!

Thank you and everyone so much for all of your help! :):)
 
Upvote 0
Since you have office 365, you can use the dynamic array formula's. There is just one formula for the whole output.
But, solved is solved ;p
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,177
Members
452,615
Latest member
bogeys2birdies

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