View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Teethless mama Teethless mama is offline
external usenet poster
 
Posts: 3,718
Default VLOOKUP and Return Last 2 Values

=VLOOKUP(LARGE(IF($B$2:$B$9="Nick",$A$2:$A$9),ROWS ($1:1)),$A$2:$C$9,3,0)

ctrl+shift+enter, not just enter
copy down


"Nick" wrote:

Here is an example table...
Date | Name | Score |
5/20/2009 | Nick | 95 |
5/21/2009 | Jon | 96 |
5/22/2009 | Jon | 97 |
5/23/2009 | Jon | 98 |
5/24/2009 | Jon | 99 |
5/25/2009 | Nick | 72 |
5/26/2009 | Jon | 45 |
5/27/2009 | Nick | 30 |

I would like to create a summary page that has "Nick" and "Jon" and returns
their last 2 most recent scores to track their current trend. So for Nick,
the result would be:
Nick
Most Recent: 30
Second Most Recent: 72
Jon
Most Recent: 45
Second Most Recent: 99

There will never be duplicate dates. The primary key is basically the date
column. I will continue to add dates on the data dump table so it will need
to have the opportunity to expand. I've searched through this for a while
and can't find my answer. Any help is greatly appreciated!