nth Occurrence lookup within an array returning from specific column

Safire

New Member
Joined
Mar 3, 2015
Messages
2
Hello,
I'm trying to do a nth occurrence lookup (probably with a macro), among an array of data and returning the value from a specific column within the same row.

I'm trying to look up student scholarship assignments from the following data:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Scholarship Name
[/TD]
[TD]Awardee Student#1
[/TD]
[TD]Awardee Student#2
[/TD]
[TD]Awardee Student#3
[/TD]
[TD]Awardee Student#4
[/TD]
[/TR]
[TR]
[TD]Louis Jones Scholarship
[/TD]
[TD]Jonah Band, Class of 2017
[/TD]
[TD]Sean Ascot, Class of 2017
[/TD]
[TD]Ashley Verra, Class of 2015
[/TD]
[TD]Josh Dean, Class of 2018
[/TD]
[/TR]
[TR]
[TD]Blank-Smith Scholarship
[/TD]
[TD]Jane Smith, Class of 2018
[/TD]
[TD]Jonah Band, Class of 2017
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Foundation Scholarship
[/TD]
[TD]John Smith, Class of 2015
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Class of 1910 Scholarship
[/TD]
[TD]Jonah Band, Class of 2017
[/TD]
[TD]Nikki McGuire, Class of 2018
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Dr. Doug Scholarship
[/TD]
[TD]Josh Dean, Class of 2018
[/TD]
[TD]Jane Smith, Class of 2018
[/TD]
[TD]John Smith, Class of 2015
[/TD]
[TD]Sean Ascot, Class of 2017
[/TD]
[/TR]
[TR]
[TD]Daniel Scholarship
[/TD]
[TD]Jane Smith, Class of 2018
[/TD]
[TD]Sean Ascot, Class of 2017
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


On a different tab, using the student name as the lookup, the 1st occurrence of the scholarship name would appear in column B, the second scholarship in column C, etc. It would always be returning the data from the scholarship name column.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Student Name for lookup
[/TD]
[TD]Scholarship Assignment #1
[/TD]
[TD]Scholarship Assignment #2
[/TD]
[TD]Scholarship Assignment #3
[/TD]
[/TR]
[TR]
[TD]Jane Smith, Class of 2018
[/TD]
[TD]Blank-Smith Scholarship
[/TD]
[TD]Dr. Doug Scholarship
[/TD]
[TD]Daniel Scholarship
[/TD]
[/TR]
[TR]
[TD]John Smith, Class of 2015
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


I'm rather new to using macros, my experience being limited to cutting and pasting code. So I'm hoping for some assistance.

Thank you for your help!
 
try:


Book1
ABCDE
1Scholarship NameAwardee Student#1Awardee Student#2Awardee Student#3Awardee Student#4
2Louis Jones ScholarshipJonah Band, Class of 2017Sean Ascot, Class of 2017Ashley Verra, Class of 2015Josh Dean, Class of 2018
3Blank-Smith ScholarshipJane Smith, Class of 2018Jonah Band, Class of 2017
4Foundation ScholarshipJohn Smith, Class of 2015
5Class of 1910 ScholarshipJonah Band, Class of 2017Nikki McGuire, Class of 2018
6Dr. Doug ScholarshipJosh Dean, Class of 2018Jane Smith, Class of 2018John Smith, Class of 2015Sean Ascot, Class of 2017
7Daniel ScholarshipJane Smith, Class of 2018Sean Ascot, Class of 2017
8
9
10
11
12Student Name for lookupScholarship Assignment #1Scholarship Assignment #2Scholarship Assignment #3
13Jane Smith, Class of 2018Blank-Smith ScholarshipDr. Doug ScholarshipDaniel Scholarship
14John Smith, Class of 2015Foundation ScholarshipDr. Doug Scholarship
Foglio1
Cell Formulas
RangeFormula
B13{=IFERROR(INDEX($A$2:$A$7,SMALL(IF($B$2:$E$7=$A13,ROW($A$2:$A$7)-ROW($A$2)+1),COLUMNS($B$13:B13))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
You are welcome I' m glade it helped you
Thank you For Your feed-back
 
Upvote 0

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