Index Match to find multiple matches in a column

arsmith646

New Member
Joined
Aug 17, 2015
Messages
10
Hello,

I have figured out how to compare and search two columns to return a corresponding value, but there are multiple values that may match, and I am unable to collect the multiple values. The headings I am searching are below:

Full Name (this is the column I am searching - Column A); Activity Number (the value(s) I need returned - Column B); Pass2 (the column I am using to search for the name in Column A - Column C); Then the remaining columns need to return the corresponding activity or activities from the search criteria in Column C.

I'm trying to avoid having to write in VBA using a For Loop and am wondering if there is any way to collect this data using the function below:

=INDEX(B:B,MATCH(C2,A:A,0))

This will only return a single matching activity from Column B.

Please let me know if I'm unclear, and I want to thank you for your help in advance.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Here's one way.

Excel 2010
ABCDEF
1Full NameActivity NumberPass2Activity 1Activity 2Activity 3
2Joe Blow1John Doe268
3John Doe2Max Power57
4Jane Roe3
5Joe Blow4
6Max Power5
7John Doe6
8Max Power7
9John Doe8
10Mary Smith9

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet4

Array Formulas
CellFormula
D2{=IFERROR(INDEX($B:$B,SMALL(IF($A$2:$A$10=$C2,ROW($A$2:$A$10),9E+99),COLUMN(D2)-COLUMN($D$2)+1)),"")}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



Put the formula in D2, confirm with Control-Shift-Enter. Then copy D2 and paste it in the cells as far to the right as needed, and as far down the column as needed. If I've created the sample sheet correctly, you should have what you need.

Let me know how it works.
 
Upvote 0
Thank you so much! It works wonders. I was working on the macro for it, and it was taking forever. I greatly appreciate the help.
 
Upvote 0
Hello again,

I was hoping you could help me if I needed to match another two columns to return a value matching criteria. In other words, in addition to the members names matching, I would also have to match the activity numbers to pull out the amount someone paid for that activity. Like with these headers:

PassMember1 Activity AmountPaid Activity2 Enrollee TotPaid

I would need to find the PassMember1 that matches Enrolee as well as the Activity match Activity2 to return the TotPaid into the AmountPaid column. Does that make sense?

Thank you again for all your help!
 
Upvote 0

Forum statistics

Threads
1,214,879
Messages
6,122,065
Members
449,064
Latest member
scottdog129

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