Auto Sorting League Table

Simon Pipe

New Member
Joined
Sep 20, 2011
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hi,

I run football prediction competitions at work for every major tournament such as World Cup and Euro's It is just for fun and I have done since 2002. Over the years I have tweaked and added to my spreadsheets and works really well with me needing to less and less and excel doing it all for me!

The one thing now though I would like to refine is the league table. I am unable to use XL2BB due to 'IT restrictions' on work laptop so will include screen grabs.

Background is each player predicts whether a team will win, lose or draw each match and based on that against actual results get points. 10 if correct, zero if wrong. They send me all their predictions and they get their own sheet in workbook. Can be up to 100 players. Below is Tab P1

1717516321687.png


I have a master sheet called 'Match results' and I enter the actual result in it which then populates their scoresheet respectively in column H above and then allocated points.

The sheet 'Table' (below) totals all the scores per player and round from each players sheet. Table A is the main one.

1717516490617.png


This is where I need help....

I have to manually copy across the data from the table (Table A) from C5 to K14 in to a dummy table (Table B) N5 to V10 using paste 123 before I enter any scores. This way, when I have entered them, I can do a sort on Table A which compares against B to show who has moved up/down the table based on new points totals.

The sort is Column I then H, then G...F...E...D. Except for the last sort for final table whereby Column K is included.

There must be a better way of doing the table so that I don't have to sort manually or copy across data and it does it for me?

Formula I use at the moment:
B5 =IF(MATCH(C5,N:N,0)-ROW()>0,"▲ "&MATCH(C5,N:N,0)-ROW(),IF(MATCH(C5,N:N,0)-ROW()<0,"▼ "&ABS(MATCH(C5,N:N,0)-ROW()),"-")) (Has conditional formatting on it for colours)
C5 ='P4'!$D$2
D5 =IFERROR(@INDIRECT("'"&C5&"'!k43"),0)
E5 =IFERROR(@INDIRECT("'"&C5&"'!k56"),0)
I5 =IFERROR(@INDIRECT("'"&C5&"'!k80"),0)

Hopefully this makes sense and any help would be gratefully received!

Thanks, Simon
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Sorry to bump - hoping it does make sense but if I need to refine let me know!
 
Upvote 0
Hi

Please keep records of different rounds in different sheets- 'Round1', 'Round2', 'Round3' etc

Auto sorting
Please have two sections in these sheets- have two sections col M to W- the array in itself and the sorted array - col A to K

in col C, pls put formula =SORTBY(O3:W14,T3:T14,-1,S3:S14,-1....)
This would sort the input given in cells O3 to W14 and output the same in cells C3 to K14

Col A has the rank no and Col B has the position up/down, which would be explained below

T3:T14 is the first column to be checked for sorting
S3:S14 the second and so on
-1 implies descending order

Getting the position up/down v previous round

Eg: Round3 has been completed
In a cell (say cell J1) in Round3 sheet, pls put a formula, =MID(CELL("filename"),FIND("]",CELL("filename"),1)+1,LEN(CELL("filename")))- this will give the name of the sheet, ie, Round3 in this case

In cell J2, pls put ="Round"&SUBSTITUTE(J1,"Round","")*1-1) this will give Round2, ie, the previous round from Round3

Pls modify the formula and put in B5
=IF(MATCH(C5,INDIRECT($J$2&"!c:c"),0)-ROW()>0,"▲ "&MATCH(C5,INDIRECT($J$2&"!c:c"),0)-ROW(),IF(MATCH(C5,INDIRECT($J$2&"!c:c"),0)-ROW()<0,"▼ "&ABS(MATCH(C5,INDIRECT($J$2&"!c:c"),0)-ROW()),"-"))

This looks at the previous round sheet, as pointed by cell J2, compares it against the current round and gives the position up/down

Please check and do let know

Please find a depiction below (only two orders of sorting have been given)

Rounds.xlsx
ABCDEFGHIJKLMNOPQRSTUVW
1Current Round NameRound3
2Previous RoundRound2
3
4Current Position
51▲ 3P4110101P411010
62▲ 1P38052P3805
73▼ 2P16053P2604
84▼ 2P26044P1605
95-P5005P5
106-P6006P6
117-P7007P7
128-P8008P8
139-P9009P9
1410-P100010P10
Round3
Cell Formulas
RangeFormula
J1J1=MID(CELL("filename"),FIND("]",CELL("filename"),1)+1,LEN(CELL("filename")))
J2J2="Round"&SUBSTITUTE(J1,"Round","")*1-1
C5:E14C5=SORTBY(O5:Q14,P5:P14,-1,Q5:Q14,-1)
B5:B14B5=IFERROR(IF(MATCH(C5,INDIRECT($J$2&"!c:c"),0)-ROW()>0,"▲ "&MATCH(C5,INDIRECT($J$2&"!c:c"),0)-ROW(),IF(MATCH(C5,INDIRECT($J$2&"!c:c"),0)-ROW()<0,"▼ "&ABS(MATCH(C5,INDIRECT($J$2&"!c:c"),0)-ROW()),"-")),"-")
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,735
Messages
6,180,635
Members
452,991
Latest member
JM_000888

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