Determining Rankings

Phil042

New Member
Joined
Feb 18, 2025
Messages
3
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Good afternoon all

I am very new to Excel and have been trust into the fire on a learn as you go. I have been given a database of men and women. there are 2 pools in each catagory A&B also there is a standings that tabulates the numbers.

My problem is that i can only get the standings of the men or women, not both. Sheets 2&3 are men's A&B Pools, Sheets 5&6 are women's. Sheet 1 displays the men's standings and sheet 4 displays the women's standings.

The standings are displayed. the names & numbers are correct but the SORT is not corect.

I can only print the standings of the men or women not both.

Does that make sense to anyone ????


SortPoolRanking.jpg
 
Welcome to the Forum!
I am very new to Excel ...
I am guessing this means you didn't write the VBA code, and you are trying (unsuccessfully) to use the code already in the workbook?

If so, is there any reason you can't ignore the code, and sort the four tables (i.e. two pools x Male/Female) manually?

Here's a sample layout that I want to sort on column F:

ABCDEFG
1
2CompetitorClubBlahBlahStanding
3ABlahBlahBlah3
4BBlahBlahBlah1
5CBlahBlahBlah4
6DBlahBlahBlah6
7EBlahBlahBlah2
8FBlahBlahBlah5
9
Sheet1


In Excel, select the range B2:F8, choose Data/Sort:

1739923438763.png

Click the "OK" button, and the result will be:

ABCDEF
1
2CompetitorClubBlahBlahStanding
3BBlahBlahBlah1
4EBlahBlahBlah2
5ABlahBlahBlah3
6CBlahBlahBlah4
7FBlahBlahBlah5
8DBlahBlahBlah6
9
Sheet1
 
Upvote 0
I am hoping the following makes sense

2 pools of Men and 2 pools of women. Each pool calculates the total distances of throws and gives us the "Rank Distance" Using a formula we can determine the rankings.

Ranking.jpg

The data from Pools A, B, C & D are compiled into a Men's or Women's Standings. # of throws, total distance over # of throws. Subtract the 2 highest throws gives us the rank distance which in turn gives us the pool ranking. The problem I have is that I can not get the rankings of both men and women. It is one or the other

Team A.jpg

I've attached the macro which used to provide the pool Ranking

Pool Ranking.jpg


Also attached are the formulas

Formulas.jpg
 
Upvote 0
Welcome to the Forum!

I am guessing this means you didn't write the VBA code, and you are trying (unsuccessfully) to use the code already in the workbook?

If so, is there any reason you can't ignore the code, and sort the four tables (i.e. two pools x Male/Female) manually?

Here's a sample layout that I want to sort on column F:

ABCDEFG
1
2CompetitorClubBlahBlahStanding
3ABlahBlahBlah3
4BBlahBlahBlah1
5CBlahBlahBlah4
6DBlahBlahBlah6
7EBlahBlahBlah2
8FBlahBlahBlah5
9
Sheet1


In Excel, select the range B2:F8, choose Data/Sort:

View attachment 122514
Click the "OK" button, and the result will be:

ABCDEF
1
2CompetitorClubBlahBlahStanding
3BBlahBlahBlah1
4EBlahBlahBlah2
5ABlahBlahBlah3
6CBlahBlahBlah4
7FBlahBlahBlah5
8DBlahBlahBlah6
9
Sheet1
Stephen. Please check out my latest post.. Thanks
 
Upvote 0
Let's take this step by step ...
Sheets 2&3 are men's A&B Pools, Sheets 5&6 are women's. Sheet 1 displays the men's standings and sheet 4 displays the women's standings.
I am assuming that Sheet1 shows two men's results tables - one for Pool A and one for Pool B.

If the code you've posted is sorting correctly, then this men's summary sheet is called "Men Standings Round Robin", the two tables are in ranges B7:G16 and B20:G29, and both are sorted on column G.

When you say in Post #1 that the "sort is not correct", it's not clear whether:

a) You're referring to these tables and the code is not working, or
b) The code is working and the incorrect sort is in some higher level table(s)?

I've shown you how to do a manual sort, so I am assuming that one way or another, you can get two correctly sorted tables on the "Men Standings Round Robin" sheet?

I have assumed that similar will apply to the women's results, and that one way or another, you can get two correctly sorted tables on Sheet4 (which is perhaps named "Women Standings Round Robin"?

What is not clear is:
The problem I have is that I can not get the rankings of both men and women. It is one or the other

It sounds like you have a higher level summary table that aggregates results for Pool A and Pool B, with the option of doing this for men, or for women, and you want the third option of combining men and women?

Is this being done by VBA or by formulae? Is this working for men only and for women only? Or is this where the table is collating correctly but the sort is not working?

If you will always be using Excel 365, this could be done relatively easily with formulae:

ABCDEFGH
1IncludeBoth
2Combined
3TeamBlahBlahBlahRank distanceLSD rank
4BWA blahWA blahWA blah5401
5LMB blahMB blahMB blah5502
6AWA blahWA blahWA blah5703
7KMB blahMB blahMB blah5804
8EWB blahWB blahWB blah6005
9DWB blahWB blahWB blah7006
10GMA blahMA blahMA blah7006
11HMA blahMA blahMA blah7006
12JMB blahMB blahMB blah8009
13CWA blahWA blahWA blah100010
14FWB blahWB blahWB blah100010
15IMA blahMA blahMA blah120012
16
17Womens A
18TeamBlahBlahBlahRank distanceLSD rank
19AWA blahWA blahWA blah5702
20BWA blahWA blahWA blah5401
21CWA blahWA blahWA blah10003
22etcWA blahWA blahWA blah
23
24Womens B
25TeamBlahBlahBlahRank distanceLSD rank
26DWB blahWB blahWB blah7002
27EWB blahWB blahWB blah6001
28FWB blahWB blahWB blah10003
29etcWB blahWB blahWB blah
30
31Mens A
32TeamBlahBlahBlahRank distanceLSD rank
33GMA blahMA blahMA blah7001
34HMA blahMA blahMA blah7001
35IMA blahMA blahMA blah12003
36etcMA blahMA blahMA blah
37
38Mens B
39TeamBlahBlahBlahRank distanceLSD rank
40JMB blahMB blahMB blah8003
41KMB blahMB blahMB blah5802
42LMB blahMB blahMB blah5501
43etcMB blahMB blahMB blah
44
Sheet1
Cell Formulas
RangeFormula
B4:G15B4=LET(W,VSTACK(B19:F21,B26:F28),M,VSTACK(B33:F35,B40:F42),B,VSTACK(W,M),show,SORT(IF(Include="Men",M,IF(Include="Women",W,B)),5),dist,TAKE(show,,-1),HSTACK(show,BYROW(dist,LAMBDA(r,MATCH(r,dist,)))))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Include=Sheet1!$E$1B4
Cells with Data Validation
CellAllowCriteria
E1ListMen, Women,Both

It's hard to work with pictures, so when you're posting screenshots, ideally you'd use our XL2BB add-in. That way we can simply click here and copy/paste into a workbook for testing:

1740010786148.png


Or if that's a step too far, paste in table format, with row and column headers written in, so we can see which cells are being used.


BCDEFG
1IncludeBoth
2Combined
3TeamBlahBlahBlahRank distanceLSD rank
4BWA blahWA blahWA blah5401
5LMB blahMB blahMB blah5502
6AWA blahWA blahWA blah5703
7KMB blahMB blahMB blah5804
8EWB blahWB blahWB blah6005
9DWB blahWB blahWB blah7006
10GMA blahMA blahMA blah7006


And if you're posting code, please put it in code tags:
1740011319261.png

VBA Code:
'So that your code looks like this
'and can be copied/pasted for us to test
 
Upvote 0

Forum statistics

Threads
1,226,795
Messages
6,193,047
Members
453,772
Latest member
aastupin

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