Generate list from column A for all B cells containing number C

jnelson522

New Member
Joined
Oct 30, 2017
Messages
7
I have a sheet with a list of names (A), followed by a cell (B) which contains one or more years separated by commas.

I want to generate a list of all names from A when B contains the number in D:

[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]John Doe[/TD]
[TD]1998, 2005, 2014[/TD]
[TD][/TD]
[TD]2005[/TD]
[TD]John Doe[/TD]
[/TR]
[TR]
[TD]Jane Doe[/TD]
[TD]2012, 2014, 2017[/TD]
[TD][/TD]
[TD][/TD]
[TD]George Spelvin[/TD]
[/TR]
[TR]
[TD]George Spelvin[/TD]
[TD]2005, 2012, 2017[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2012[/TD]
[TD]Jane Doe[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]George Spelvin[/TD]
[/TR]
</tbody>[/TABLE]

I suspect this is possible using INDEX and MATCH, or INDEX and COUNT(FIND). Much obliged for any suggestions.
 
Thanks, Peter. I am indeed working on an ancient computer with ancient program versions! Also trying to use Google sheets.

FYI, I've received replies from two users with array formulas based on yours, made compatible with Excel 2003:
=INDEX(Data!$A$3:$A$20,SMALL(IF(ISNUMBER(FIND($A$1,INDEX(Data!$B$3:$B$20,,MATCH(A$2, Data!$B$2:$M$2,0)))),ROW(Data!$B$3:$B$20)-ROW(Data!B$3)+1),ROWS(A$3:A3)))

=IFERROR(INDEX(Data!$A$1:$A$999,SMALL(IF(ISNUMBER(SEARCH($A$1,Data!B$1:B$999)),ROW(Data!$A$1:$A$999)-(ROW(Data!$A$1)-1)),ROWS($A$1:$A1))),"")

Most grateful for your help with this project.

Best,
John
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Understood, Peter - my testing in G-sheets was secondary, as I was indeed trying to work this out in Excel.

Best,
jn
 
Upvote 0

Forum statistics

Threads
1,223,970
Messages
6,175,726
Members
452,667
Latest member
vanessavalentino83

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