Alternative to using the Choose function

JonnyStout

New Member
Joined
Nov 19, 2009
Messages
14
I'm doing a leaderboard and there are over 29 entrants.
I am trying to show what place each person is in and there is also ties.

I was using the Choose function when the entrants were smaller, I didn't know about the 29 limit.
There are 35 entries.

This is the formula I'm using (in this example cell 33):
=IF(OR(A33=A34,A33=A32),"T"&A33,A33)&CHOOSE(A33,"st","nd","rd","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","th","st","nd","rd","th","th","th","th","th","th","th","st","nd","rd","th","th")
Column A has their ranking and it returns it, T if it's tied with the previous and then the correct suffix.
This works up to 29.

I'm wondering if there is a way of adding the suffix without the Choose function.
Or maybe breaking it down to groups of 10 somewhere and calculate it there and then return but I can't figure it out.
 

Attachments

  • Leaderboard.png
    Leaderboard.png
    5.3 KB · Views: 8

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Thanks @Joe4.

@JonnyStout: The formula I gave you didn't go to 35th numbers. Here is a more robust formula that should take care of many many more:

Excel Formula:
=IF(OR(A33=A34,A33=A32),"T"&A33,A33)&
&IF(AND(A33>=11,A33<=13),"th",SWITCH(1*RIGHT(A33,1),1,"st",2,"nd",3,"rd","th"))
 
Upvote 0
Thanks, but that's producing a Parse Error
I just expanded your formula to include the 30s and it's fine. I know that if it gets higher it would need refining.
 
Last edited:
Upvote 0
Thanks, but that's producing a Parse Error
I just expanded your formula to include the 30s and it's fine. I know that if it gets higher it would need refining.
the formula I gave in post 5 should work, i thinks it something with the tie breaker or cell references. I'll get it. I don't like to be 90% correct. :) I make mistakes, and that is how I learn. Here is a corrected version:

Book1 (version 1).xlsb
ABCD
32
3311st1st
3422nd2nd
3533rd3rd
365T5thT5th
375T5thT5th
3866th6th
3977th7th
4088th8th
4199th9th
421010th10th
431111th11th
441212th12th
451313th13th
461414th14th
471515th15th
481616th16th
491717th17th
501818th18th
Sheet9
Cell Formulas
RangeFormula
B33:B50B33=IF(OR(A33=A34,A33=A32),"T"&A33,A33)& SWITCH(A33,1,"st",2,"nd",3,"rd",21,"st",22,"nd",23,"rd","th")
D33:D50D33=IF(OR(A33=A34,A33=A32),"T"&A33,A33)& IF(AND(A33>=11,A33<=13),"th",SWITCH(1*RIGHT(A33,1),1,"st",2,"nd",3,"rd","th"))
 
Upvote 0
No, I had an error. I think I had two consecutive ampersands in Post 5 formula. (before and after the line break)
 
Upvote 0

Forum statistics

Threads
1,215,537
Messages
6,125,390
Members
449,222
Latest member
taner zz

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