# Match Array Formula

I have a spreadsheet attached. On sheet 1 I have a control, control type, and various objectives for the control. On sheet2 I am trying to write some formula that will match the Control Type and scan the array in Sheet1!C2 to locate the Objective ID. Then in Sheet2 place the Control from Sheet1A2 into Sheet2!C2.

Sample.xlsx
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Analyst Assistant Commented:
No file attached I'm afraid.:)
0
Author Commented:
0
Excel & VBA ExpertCommented:
Try this formula and see if this is what you are trying to achieve...

In C2 on Sheet2,
``````=INDEX(Table1[Control],MATCH(1,INDEX((Table1[Control Type]=TRIM(B2))*(ISNUMBER(SEARCH(A2,Table1[Objective ID]))),),0))
``````
0
Author Commented:
Thank you so much. That is very helpful. Just one follow-up question. I uploaded an edited version of the file in which we have multiple F6 Objective ID on Sheet1. Ideally would like it to show both results in a single cell on Sheet2. How would I go about doing this?
0
Excel & VBA ExpertCommented:
If you are using Excel 2016 or 365, you can use a function called TEXTJOIN to get the desired output otherwise you will need a VBA solution to get the desired output.

In C2 on Sheet2
``````=TEXTJOIN(", ",TRUE,IF(Table1[Control Type]=TRIM(B2),IF(ISNUMBER(SEARCH(A2,Table1[Objective ID])),Table1[Control])))
``````
0

Experts Exchange Solution brought to you by