Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
quailhunter
 
Posts: n/a
Default How to return top 5 scores?


I have an interesting situation in an Excel spreadsheet and I was
wondering if there's a way to handle this?

I'm looking to return the top 5 scores, and the person's name
associated with the score. The problem is, when I use the INDEX MATCH
function, I always return the same person if there is more than one
individual with exactly the same score.

=INDEX(A1:A5,MATCH(LARGE(B1:B5,1),B1:B5,0))

Johnson 154
Alberts 160
Smith 154
Able 120
Reese 110

If I change the '1' in the LARGE function to 2, then to 3... It returns
Alberts, then Johnson, then Johnson again... So, it's only finding the
first occurrence of Johnson and not returning Smith for '3'...

Is there anyway to code this problem so I'd return Alberts, Johnson,
Smith???


--
quailhunter
------------------------------------------------------------------------
quailhunter's Profile: http://www.excelforum.com/member.php...o&userid=27739
View this thread: http://www.excelforum.com/showthread...hreadid=472479

  #2   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Try this:

Entered as an array using the key combo of CTRL,SHIFT,ENTER:

=INDEX(A$1:A$5,MATCH(LARGE(B$1:B$5+(ROW(B$1:B$5)/10^10),ROW(A1)),B$1:B$5+(ROW(B$1:B$5)/10^10),0))

Copy down as needed.

Biff

"quailhunter"
wrote in message
...

I have an interesting situation in an Excel spreadsheet and I was
wondering if there's a way to handle this?

I'm looking to return the top 5 scores, and the person's name
associated with the score. The problem is, when I use the INDEX MATCH
function, I always return the same person if there is more than one
individual with exactly the same score.

=INDEX(A1:A5,MATCH(LARGE(B1:B5,1),B1:B5,0))

Johnson 154
Alberts 160
Smith 154
Able 120
Reese 110

If I change the '1' in the LARGE function to 2, then to 3... It returns
Alberts, then Johnson, then Johnson again... So, it's only finding the
first occurrence of Johnson and not returning Smith for '3'...

Is there anyway to code this problem so I'd return Alberts, Johnson,
Smith???


--
quailhunter
------------------------------------------------------------------------
quailhunter's Profile:
http://www.excelforum.com/member.php...o&userid=27739
View this thread: http://www.excelforum.com/showthread...hreadid=472479



  #3   Report Post  
Biff
 
Posts: n/a
Default

P.S. -

Is there anyway to code this problem so I'd return Alberts, Johnson,
Smith???


My formula will return:

Alberts
Smith
Johnson
Able
Reese

If you want to "flip" Smith and Johnson just change this portion of the
formula in both places:

+(ROW(B$1:B$5)/10^10

Change to:

-(ROW(B$1:B$5)/10^10

Biff

"Biff" wrote in message
...
Hi!

Try this:

Entered as an array using the key combo of CTRL,SHIFT,ENTER:

=INDEX(A$1:A$5,MATCH(LARGE(B$1:B$5+(ROW(B$1:B$5)/10^10),ROW(A1)),B$1:B$5+(ROW(B$1:B$5)/10^10),0))

Copy down as needed.

Biff

"quailhunter"
wrote in message
...

I have an interesting situation in an Excel spreadsheet and I was
wondering if there's a way to handle this?

I'm looking to return the top 5 scores, and the person's name
associated with the score. The problem is, when I use the INDEX MATCH
function, I always return the same person if there is more than one
individual with exactly the same score.

=INDEX(A1:A5,MATCH(LARGE(B1:B5,1),B1:B5,0))

Johnson 154
Alberts 160
Smith 154
Able 120
Reese 110

If I change the '1' in the LARGE function to 2, then to 3... It returns
Alberts, then Johnson, then Johnson again... So, it's only finding the
first occurrence of Johnson and not returning Smith for '3'...

Is there anyway to code this problem so I'd return Alberts, Johnson,
Smith???


--
quailhunter
------------------------------------------------------------------------
quailhunter's Profile:
http://www.excelforum.com/member.php...o&userid=27739
View this thread:
http://www.excelforum.com/showthread...hreadid=472479





  #4   Report Post  
quailhunter
 
Posts: n/a
Default


Biff,
Your code worked like a charm. I used the -(ROW(B$1:B$5)/10^10, and got
exactly what I was looking for... Q. How do I modify so the next column
over in my report will display the score for each individual?

Biff Wrote:
P.S. -

Is there anyway to code this problem so I'd return Alberts, Johnson,
Smith???


My formula will return:

Alberts
Smith
Johnson
Able
Reese

If you want to "flip" Smith and Johnson just change this portion of
the
formula in both places:

+(ROW(B$1:B$5)/10^10

Change to:

-(ROW(B$1:B$5)/10^10

Biff

"Biff" wrote in message
...
Hi!

Try this:

Entered as an array using the key combo of CTRL,SHIFT,ENTER:


=INDEX(A$1:A$5,MATCH(LARGE(B$1:B$5+(ROW(B$1:B$5)/10^10),ROW(A1)),B$1:B$5+(ROW(B$1:B$5)/10^10),0))

Copy down as needed.

Biff

"quailhunter"


wrote in message
...

I have an interesting situation in an Excel spreadsheet and I was
wondering if there's a way to handle this?

I'm looking to return the top 5 scores, and the person's name
associated with the score. The problem is, when I use the INDEX

MATCH
function, I always return the same person if there is more than one
individual with exactly the same score.

=INDEX(A1:A5,MATCH(LARGE(B1:B5,1),B1:B5,0))

Johnson 154
Alberts 160
Smith 154
Able 120
Reese 110

If I change the '1' in the LARGE function to 2, then to 3... It

returns
Alberts, then Johnson, then Johnson again... So, it's only finding

the
first occurrence of Johnson and not returning Smith for '3'...

Is there anyway to code this problem so I'd return Alberts,

Johnson,
Smith???


--
quailhunter

------------------------------------------------------------------------
quailhunter's Profile:
http://www.excelforum.com/member.php...o&userid=27739
View this thread:
http://www.excelforum.com/showthread...hreadid=472479





--
quailhunter
------------------------------------------------------------------------
quailhunter's Profile: http://www.excelforum.com/member.php...o&userid=27739
View this thread: http://www.excelforum.com/showthread...hreadid=472479

  #5   Report Post  
Biff
 
Posts: n/a
Default

Hi!

How do I modify so the next column
over in my report will display the score for each individual?


Use a different, less complicated lookup formula:

Assume the original table is in A1:B5

The extracted top 5 names are in the range D1:D5

In E1 enter this formula and copy down:

=VLOOKUP(D1,A$1:B$5,2,0)

Biff

"quailhunter"
wrote in message
...

Biff,
Your code worked like a charm. I used the -(ROW(B$1:B$5)/10^10, and got
exactly what I was looking for... Q. How do I modify so the next column
over in my report will display the score for each individual?

Biff Wrote:
P.S. -

Is there anyway to code this problem so I'd return Alberts, Johnson,
Smith???


My formula will return:

Alberts
Smith
Johnson
Able
Reese

If you want to "flip" Smith and Johnson just change this portion of
the
formula in both places:

+(ROW(B$1:B$5)/10^10

Change to:

-(ROW(B$1:B$5)/10^10

Biff

"Biff" wrote in message
...
Hi!

Try this:

Entered as an array using the key combo of CTRL,SHIFT,ENTER:


=INDEX(A$1:A$5,MATCH(LARGE(B$1:B$5+(ROW(B$1:B$5)/10^10),ROW(A1)),B$1:B$5+(ROW(B$1:B$5)/10^10),0))

Copy down as needed.

Biff

"quailhunter"


wrote in message
...

I have an interesting situation in an Excel spreadsheet and I was
wondering if there's a way to handle this?

I'm looking to return the top 5 scores, and the person's name
associated with the score. The problem is, when I use the INDEX

MATCH
function, I always return the same person if there is more than one
individual with exactly the same score.

=INDEX(A1:A5,MATCH(LARGE(B1:B5,1),B1:B5,0))

Johnson 154
Alberts 160
Smith 154
Able 120
Reese 110

If I change the '1' in the LARGE function to 2, then to 3... It

returns
Alberts, then Johnson, then Johnson again... So, it's only finding

the
first occurrence of Johnson and not returning Smith for '3'...

Is there anyway to code this problem so I'd return Alberts,

Johnson,
Smith???


--
quailhunter

------------------------------------------------------------------------
quailhunter's Profile:
http://www.excelforum.com/member.php...o&userid=27739
View this thread:
http://www.excelforum.com/showthread...hreadid=472479





--
quailhunter
------------------------------------------------------------------------
quailhunter's Profile:
http://www.excelforum.com/member.php...o&userid=27739
View this thread: http://www.excelforum.com/showthread...hreadid=472479





  #6   Report Post  
quailhunter
 
Posts: n/a
Default


Biff,
Thanks for your excellent feedback. You're a genius...

Thanks again...


--
quailhunter
------------------------------------------------------------------------
quailhunter's Profile: http://www.excelforum.com/member.php...o&userid=27739
View this thread: http://www.excelforum.com/showthread...hreadid=472479

  #7   Report Post  
CLR
 
Posts: n/a
Default

Take a look at Data Filter Autofilter..........it will return the entire
row of the Top5 scores, including duplicates.......

Vaya con Dios,
Chuck, CABGx3



"quailhunter"
wrote in message
...

I have an interesting situation in an Excel spreadsheet and I was
wondering if there's a way to handle this?

I'm looking to return the top 5 scores, and the person's name
associated with the score. The problem is, when I use the INDEX MATCH
function, I always return the same person if there is more than one
individual with exactly the same score.

=INDEX(A1:A5,MATCH(LARGE(B1:B5,1),B1:B5,0))

Johnson 154
Alberts 160
Smith 154
Able 120
Reese 110

If I change the '1' in the LARGE function to 2, then to 3... It returns
Alberts, then Johnson, then Johnson again... So, it's only finding the
first occurrence of Johnson and not returning Smith for '3'...

Is there anyway to code this problem so I'd return Alberts, Johnson,
Smith???


--
quailhunter
------------------------------------------------------------------------
quailhunter's Profile:

http://www.excelforum.com/member.php...o&userid=27739
View this thread: http://www.excelforum.com/showthread...hreadid=472479



  #8   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

See also my post in:

http://tinyurl.com/44ywo

quailhunter wrote:
I have an interesting situation in an Excel spreadsheet and I was
wondering if there's a way to handle this?

I'm looking to return the top 5 scores, and the person's name
associated with the score. The problem is, when I use the INDEX MATCH
function, I always return the same person if there is more than one
individual with exactly the same score.

=INDEX(A1:A5,MATCH(LARGE(B1:B5,1),B1:B5,0))

Johnson 154
Alberts 160
Smith 154
Able 120
Reese 110

If I change the '1' in the LARGE function to 2, then to 3... It returns
Alberts, then Johnson, then Johnson again... So, it's only finding the
first occurrence of Johnson and not returning Smith for '3'...

Is there anyway to code this problem so I'd return Alberts, Johnson,
Smith???


  #9   Report Post  
Harlan Grove
 
Posts: n/a
Default

"quailhunter" wrote...
....
I'm looking to return the top 5 scores, and the person's name
associated with the score. The problem is, when I use the INDEX MATCH
function, I always return the same person if there is more than one
individual with exactly the same score.

=INDEX(A1:A5,MATCH(LARGE(B1:B5,1),B1:B5,0))

Johnson 154
Alberts 160
Smith 154
Able 120
Reese 110

If I change the '1' in the LARGE function to 2, then to 3... It
returns Alberts, then Johnson, then Johnson again... So, it's only
finding the first occurrence of Johnson and not returning Smith for
'3'...

Is there anyway to code this problem so I'd return Alberts, Johnson,
Smith???


Another alternative involving only one cell per result but assuming later
results can rely on earlier results. If your sample data above were in
A1:B5, then try these array formulas.

E1:F1:
=INDEX(A1:B5,MATCH(MAX(B1:B5),B1:B5,0),0)

E2:F2:
=INDEX($A$1:$B$5,MATCH(MAX(IF(COUNTIF(E$1:E1,$A$1: $A$5)
*COUNTIF(F$1:F1,$B$1:$B$5)=0,$B$1:$B$5)),
IF(COUNTIF(E$1:E1,$A$1:$A$5)*COUNTIF(F$1:F1,$B$1:$ B$5)=0,
$B$1:$B$5),0),0)

Select E2:F2 and fill down as needed.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Intervals of 1 Numeric value in a Row and Return Count down Column Sam via OfficeKB.com Excel Worksheet Functions 8 October 4th 05 04:37 PM
Huge problem with "if" formula's [email protected] Excel Discussion (Misc queries) 16 July 20th 05 07:20 PM
Excel - return a picture or range rows as the result of a formula juststarting Excel Worksheet Functions 1 July 4th 05 12:59 AM
How do create a formula to evalute a # to return 1 of 4 conditions Larry Excel Worksheet Functions 4 May 29th 05 12:58 AM
Lookup baseball scores in 1 worksheet and have them display in ano Oceanverd Excel Worksheet Functions 3 May 1st 05 04:44 AM


All times are GMT +1. The time now is 11:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"