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:

ABCDE
John Doe1998, 2005, 20142005John Doe
Jane Doe2012, 2014, 2017George Spelvin
George Spelvin2005, 2012, 2017
2012Jane Doe
George Spelvin

<tbody>
</tbody>

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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
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,216,182
Messages
6,129,364
Members
449,506
Latest member
nomvula

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