Find multiple hits matching one criterion eg with index/match or vlookup etc

Son

Active Member
Joined
Mar 19, 2010
Messages
284
Hi, I've been trying to find mutliple hits matching one criterion (column E) so as to produce the following results in column F:


ABCDEF
TYPENAMECRITERIARETURN VALUE
1.0.1JOHN1.0
0 1.0.1JOHN
1.0.2MARY1.0.2MARY
0 2.0
2.0.1GEORGE2.0.1GEORGE
0 2.0.2ADAM
2.0.2ADAM2.0.2JOHN
2.0.2JOHN2.1
0 2.1.1HELEN
2.1.1HELEN2.1.1MARY
2.1.1MARY2.1.1ANNE
2.1.1ANNE2.1.1JIM
2.1.1JIM2.2
0 2.2.1MARY
2.2.1MARY2.2.1CHARLES
2.2.1CHARLES2.2.1ERIC
2.2.1ERIC2.2.1JOHN
2.2.1JOHN

<colgroup><col span="5"><col></colgroup><tbody>
</tbody>


In column A, I have the codes and in column B there are the corresponding names.

I need to have the codes in column E and in column F to have all the names corresponding to each code. As you can see, there are more than one instances in some codes.

Do you think this is possible? Of course index/match in the classic way I'm using it, produces only the first name for each code.

I've been trying for quite some time to find something to solve it, but I have not been successful. So, I'd appreciate your thoughts on this!!!

Thanks in advance for any advice.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Actually, it's a fixed list. So I just needed the F column in my exhibit to be filled with names (or G column in the above solution example).

Thanks for your input!!!

In G2 control+shift+enter, not just enter, and copy down:

=IF(ISNUMBER(MATCH($F2,$A$2:$A$19,0)),INDEX($B$2:$B$19,SMALL(IF($A$2:$A$19=$F2,ROW($A$2:$A$19)-ROW($A$2)+1),COUNTIFS($F$2:F2,F2))),"")

Note 1. You don't need helper columns.
Note 2. This formula is robust against inserting rows in front of the current first row.
 
Upvote 0
In G2 control+shift+enter, not just enter, and copy down:

=IF(ISNUMBER(MATCH($F2,$A$2:$A$19,0)),INDEX($B$2:$B$19,SMALL(IF($A$2:$A$19=$F2,ROW($A$2:$A$19)-ROW($A$2)+1),COUNTIFS($F$2:F2,F2))),"")

Note 1. You don't need helper columns.
Note 2. This formula is robust against inserting rows in front of the current first row.


Hi, thanks so much for posting this alternative way. I understand it's more robust, but I now see that it uses countifs. As I'm still using excel 2003, I believe I can't use countifs. The reason I'm still using excel 2003 is that excel 2010 and on, does not support the vba that it is written in the workbook, and I still haven't found a way to convert it to the 2010 version.

Anyway, I'm using Admiral's solution with one helper column and I'm having the job done, even if it takes a lot more work.

Thanks again for your help!
 
Upvote 0
Hi, thanks so much for posting this alternative way. I understand it's more robust, but I now see that it uses countifs. As I'm still using excel 2003, I believe I can't use countifs. The reason I'm still using excel 2003 is that excel 2010 and on, does not support the vba that it is written in the workbook, and I still haven't found a way to convert it to the 2010 version.

Anyway, I'm using Admiral's solution with one helper column and I'm having the job done, even if it takes a lot more work.

Thanks again for your help!

Just replace COUNTIFS with COUNTIF.
 
Upvote 0

Forum statistics

Threads
1,214,980
Messages
6,122,563
Members
449,088
Latest member
Motoracer88

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