Lookup/ Large/IF function - Return 5 most recent dates matching criterior

Jzfbkr

New Member
Joined
Aug 4, 2014
Messages
29
[TABLE="width: 500, align: left"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Round[/TD]
[TD]Home Team[/TD]
[TD]Home Score[/TD]
[TD]Away Score[/TD]
[TD]Away Team[/TD]
[/TR]
[TR]
[TD]13/09/2013[/TD]
[TD]1[/TD]
[TD]TEAM A[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]TEAM B[/TD]
[/TR]
[TR]
[TD]12/09/2013[/TD]
[TD]1[/TD]
[TD]TEAM C[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]TEAM D[/TD]
[/TR]
[TR]
[TD]20/09/2013[/TD]
[TD]2[/TD]
[TD]TEAM C[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]TEAM A[/TD]
[/TR]
[TR]
[TD]27/09/2013[/TD]
[TD]3[/TD]
[TD]TEAM A[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]TEAM D[/TD]
[/TR]
[TR]
[TD]05/10/2013[/TD]
[TD]4[/TD]
[TD]TEAM C[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]TEAM B[/TD]
[/TR]
[TR]
[TD]06/10/2013[/TD]
[TD]4[/TD]
[TD]TEAM D[/TD]
[TD]1[/TD]
[TD]4[/TD]
[TD]TEAM A[/TD]
[/TR]
[TR]
[TD]15/10/2013[/TD]
[TD]5[/TD]
[TD]TEAM A[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]TEAM E[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 100, align: right"]
<tbody>[TR]
[TD]TEAM A[/TD]
[/TR]
</tbody>[/TABLE]













I would like to return using the Lookup/Large/If functions.

The last 5 fixtures of the team in the input cell in the top right cell.
to return something like this.

[TABLE="class: outer_border, width: 500, align: left"]
<tbody>[TR]
[TD]DATE[/TD]
[TD]Round[/TD]
[TD]Home Team[/TD]
[TD]Home Score[/TD]
[TD]Away Score[/TD]
[TD]Away Team[/TD]
[/TR]
[TR]
[TD]15/10/2013[/TD]
[TD]5[/TD]
[TD]TEAM A[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]TEAM E[/TD]
[/TR]
[TR]
[TD]06/10/2013[/TD]
[TD]4[/TD]
[TD]TEAM D[/TD]
[TD]1[/TD]
[TD]4[/TD]
[TD]TEAM A[/TD]
[/TR]
[TR]
[TD]27/09/2013[/TD]
[TD]3[/TD]
[TD]TEAM A[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]TEAM D[/TD]
[/TR]
[TR]
[TD]20/09/2013[/TD]
[TD]2[/TD]
[TD]TEAM C[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]TEAM A[/TD]
[/TR]
[TR]
[TD]13/09/2013[/TD]
[TD]1[/TD]
[TD]TEAM A[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]TEAM B[/TD]
[/TR]
</tbody>[/TABLE]










Can anybody help me with this.

Thanks
 
Given in A1:

Excel 2010
ABCDEF
1DateRoundHome TeamHome ScoreAway ScoreAway Team
213-Sep-131TEAM A11TEAM B
312-Sep-131TEAM C21TEAM D
420-Sep-132TEAM C11TEAM A
527-Sep-133TEAM A21TEAM D
605-Oct-134TEAM C22TEAM B
706-Oct-134TEAM D14TEAM A
815-Oct-135TEAM A11TEAM E
9
10DateRoundHome TeamHome ScoreAway ScoreAway Team
1115-Oct-135TEAM A11TEAM E
1206-Oct-134TEAM D14TEAM A
1327-Sep-133TEAM A21TEAM D
1420-Sep-132TEAM C11TEAM A
1513-Sep-131TEAM A11TEAM B
Jzfbkr


Formula in A11 is =MAX(IF((B11=$B$2:$B$8),$A$2:$A$8)) Ctrl + Shift + Enter not just Enter on a PC or Command + Return on a MAC. Copied down till needed.
Formula in C11 is =INDEX(C$2:C$8,MATCH($A11,$A$2:$A$8,0)) copied down and right till needed.
 
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