+ Reply to Thread
Results 1 to 4 of 4

1st, 2nd, 3rd etc.

  1. #1
    Registered User
    Join Date
    01-29-2007
    Posts
    42

    1st, 2nd, 3rd etc.

    Hi all,

    I've developed a sheet which works works out a competitors score in a competition, and their position in the contest (using the RANK function).

    However this only displays their position as an integer number, i.e. "1" for the winner, "2" for the runner-up, etc. Is there any way I can format the range so their positions appear as 1st, 2nd, 3rd, 4th... etc?

    I could use a lookup table to get this effect but I'm sure there must be another way to achieve this?

    Thanks in advance!

    Roy K.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe you could add the choose function to your formula

    e.g If A1 = 1 returns 1st etc

    =A1&CHOOSE(A1,"st","nd","rd","th")
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Or may this if its less than 21 in total

    =IF(A1>4,A1&"th",A1&CHOOSE(A1,"st","nd","rd","th"))
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    For any number in A1

    =A1&IF(OR(MOD(A1,100)={11,12,13}),"th",CHOOSE(MIN(5,RIGHT(A1)+1),"th","st","nd","rd","th"))

    Obviously you can do this with one formula if you substitute your RANK function for each of the A1s in the above.....


    edit....for up to 20, you could use

    =A1&LOOKUP(A1,{0,1,2,3,4;"th","st","nd","rd","th"})
    Last edited by daddylonglegs; 02-09-2008 at 04:55 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1