Match value in Coulmn A and list all values in adjoining rows

confused5

New Member
Joined
Jan 8, 2015
Messages
5
I have a spreadsheet where I have a list of names in column A, and a bunch of dates listed in rows next to those names (upwards of dozens of dates spread across hundreds of columns eventually).

What I need to do, is look up the value in column A by selecting a name from a drop down, and then list all dates that are in the rows adjoining that name (some columns are blank then date, more blanks then another date [the column headers are course IDs]).

After losing two working days and the entire weekend trying to get this to work, I'm hoping someone finds this easy to solve.

As an example:
ABCDEFG
1Name1
2Name2AYB
3Name3
4Name4TG
5Name5
6Name6H
7Name7AY
8
9Selection: Name2
10Result Below
11A
12Y
13B

<tbody>
</tbody>

I could manage to get it to display one value, and I could manage to get it to work if i was only ever looking on the same row, but once I tried to get it to work by looking for a name first and then base it on the name match on which row it should list all information in, it just stopped working. I searched low and high and whilst I could find variations of this question, it was never quite the same and I couldn't get it to work based off the other ones.

Thanks for reading.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Formula in A11 confirmed with Ctrl+Shift+Enter and copied to A12:A16:

=IFERROR(INDEX(INDEX(B$1:G$7,MATCH(A$9,A$1:A$7,FALSE),0),SMALL(IF(INDEX(B$1:G$7,MATCH(A$9,A$1:A$7,FALSE),0)<>"",COLUMN(B$1:G$7)-COLUMN(B$1)+1),ROWS(A$11:A11))),"")
 
Upvote 0
Thanks Andrew, worked like a dream!

Just for my own education, would you mind shedding some light on what exactly COLUMN(B$1)+1) does in above? I think this is where I fell short in my own attempts and I don't really understand why this makes it work.

Thanks again, you're a life saver!
 
Upvote 0

Forum statistics

Threads
1,215,972
Messages
6,128,021
Members
449,414
Latest member
sameri

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