Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
hip
 
Posts: n/a
Default sorting with RANK/VLOOKUP (problem with equal ranks)


Hi, I'm creating a spreadsheet for sports that has a Group of 4 teams.
I've set up a RANK & VLOOKUP function in order to automatically sort
the table however I run into a couple of problems.

1. When 2 teams have the same rank based on points, the cell shows #N/A
so I need to know how to put in tie breakers. For example, a tie
breaker would be another column that has goal differential in it.

2. When no scores are entered in the system it also ranks all teams as
#1 and the same problem arises. I don't know if the same fix would
work for both.

Can anybody help with this?


--
hip
------------------------------------------------------------------------
hip's Profile: http://www.excelforum.com/member.php...o&userid=31954
View this thread: http://www.excelforum.com/showthread...hreadid=516752

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
davesexcel
 
Posts: n/a
Default sorting with RANK/VLOOKUP (problem with equal ranks)


=RANK(A2,$A$2:$A$22)&IF(OR(VALUE(RIGHT(RANK(A2,$A$ 2:$A$22),2))={11,12,13}),"th",IF(OR(VALUE(RIGHT(RA NK(A2,$A$2:$A$22)))={1,2,3}),CHOOSE(RIGHT(RANK(A2, $A$2:$A$22)),"st","nd","rd"),"th"))
I tried it out, if there were ties it worked out the placements
accordingly
also when I entered 0 it gave the last placing the only time I got a NA
or error was when the cell was truely blank
Hope this helps

Here's a site you can use to check out Ranking

http://xldynamic.com/source/xld.RANK.html


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=516752

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default sorting with RANK/VLOOKUP (problem with equal ranks)

Here's a play with tiebreaks which ranks 4 teams
(w/o using RANK)

Sample construct available at:
http://www.savefile.com/files/4120555
Ranking 4 Teams with tiebreaks.xls

2 options are covered:
if higher points = better,
if lower points = better

Assume the source table below is in A1:B5

Teams Points
Team1 1
Team2 2
Team3 2
Team4 4

In C2, copied down to C5:
=IF(B2="","",B2-ROW()/10^10)

Col C = Tiebreaker col for descending sort,
if higher points = better

In D2, copied down to D5:
=IF(B2="","",B2+ROW()/10^10)

Col D = Tiebreaker col for ascending sort,
if lower points = better

In G2, copied down to G5:
=IF(COUNT($B$2:$B$5)<4,"",
INDEX($A:$A,MATCH(LARGE(C:C,ROW(A1)),C:C,0)))

In H2, copied down to H5:
=IF(COUNT($B$2:$B$5)<4,"",
INDEX($A:$A,MATCH(SMALL(D:D,ROW(A1)),D:D,0)))

G2:G5 will return the full Team ranking (if higher is better)
H2:H5 returns the full Team ranking (if lower is better)

Teams with tied points, if any, will appear in the same relative order
that they are listed in the source table

The Team rankings within G2:G5 & H2:H5 will only display
if there's complete entry of points for the 4 teams in B2:B5
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"hip" wrote in message
...

Hi, I'm creating a spreadsheet for sports that has a Group of 4 teams.
I've set up a RANK & VLOOKUP function in order to automatically sort
the table however I run into a couple of problems.

1. When 2 teams have the same rank based on points, the cell shows #N/A
so I need to know how to put in tie breakers. For example, a tie
breaker would be another column that has goal differential in it.

2. When no scores are entered in the system it also ranks all teams as
#1 and the same problem arises. I don't know if the same fix would
work for both.

Can anybody help with this?


--
hip
------------------------------------------------------------------------
hip's Profile:

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



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
Problem sorting in Excel Kat Excel Discussion (Misc queries) 2 January 19th 05 03:29 PM
Difficult Sorting Problem Rob Excel Discussion (Misc queries) 2 January 5th 05 03:05 PM
Crazy Sorting Problem..... Neal Excel Discussion (Misc queries) 1 December 30th 04 06:56 PM
Sorting problem Klaus Excel Discussion (Misc queries) 3 December 4th 04 01:55 AM
Problem Sorting Douglas Sey New Users to Excel 1 November 28th 04 07:26 PM


All times are GMT +1. The time now is 04:55 PM.

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"