I've looked everywhere for a solution to this but I can't find one and anything I think of seems not to work properly or is rather inelegant. I have 2 columns that look like this:

James Apples
James Bananas
John Apples
John Pears
Jack Bananas

I'm trying to find a formula that returns the fruit for a specified name so that I can drag the formula down and have them listed. Like this: (for James)

Apples
Bananas

So far I've managed to get it to work by using a combination of INDEX(), MATCH(), COUNTIF(), etc. but I run into a problem where the number of different fruits for a name exceed the number of rows until the first fruit for that specified name. It's difficult to explain. This is the formula I have so far.

=IF(MATCH($A$21;$B$2:$B$12;0)-MATCH($A$21;$B6:$B$12;0)<COUNTIF($B$2:$B$12;$A$21);INDEX($C$2:$C$12;2*MATCH($A$21;$B$2:$B$12;0)-MATCH($A$21;B6:$B$12;0));"")
I've attached an illustration that might be clearer. Will someone please say they can think of an elegant solution to this?

problem.xlsx