Create ordinal number format in Excel

Anonymous
2010-08-09T14:55:38+00:00

Hello,

I am wondering if anyone knows (or knows of any resources that describe) how to create an ordinal number format in MS Excel.

I am well aware of how to reformat numbers as text to create the ordinal number effect, but what I would like to do is have the numberdisplay as an ordinal number (e.g., "1st", "2nd", "3rd", etc.) while still retaining its numeric value (1, 2, 3, etc.).

The reason for this request is to be able to perform numeric functions (e.g., MIN, MAX, AVERAGE, etc.) on an array of ordinal numbers.

I have a spreadsheet that lists various athletes' scores and the ranking for each score.  I would like to be able to easily determine, for example, each athlete's best ranking by using a MIN() function on the list of ordinal numbers.  Currently the only way I can think to do this is by having the rankings as regular cardinal numbers.

I suppose it would be possible to have an adjacent, hidden column with the numeric value of each ranking, but I thought it might be more elegant if there was a way to change the format of the number without changing its value.

Any help is much appreciated!

Regards,

Craig

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

58 answers

Sort by: Newest
  1. Anonymous
    2017-11-16T13:51:53+00:00

    Okay so I've resolved this, for others who have this issue in future.

    First option:

    This will require two cells, type the number or date in A1 and change it using a formula in A2 which will return the ordinal number version of A1 in A2 (Of course, you can edit the formula to use other cell references).

    The formula below innately works for data in Number format, but if you wish to use the formula on a date then substitute "A1" for "DAY(A1)".

    Here's the formula:

    =A1&IF(AND(MOD(ABS(A1),100)>=10,MOD(ABS(A1),100)<=14),"th", CHOOSE(MOD(ABS(A1),10)+1,"th","st","nd","rd","th","th","th","th","th","th"))

    As this formula converts a cardinal number into ordinal text, to retrieve the number from the helper cell formula result of cell A2, please use the following formula:

    =LEFT(A2,LEN(A2)-2)

    Second option: (The better resolve, in my opinion, albeit more tedious to implement)

    This resolve requires use of conditional formatting and does not require a helper cell, as it will format each cell value governed by the conditional formatting rule without changing the stored data.

    If you wish to use the conditional formatting on Date values rather than Numbers, then substitute "A1" for "TEXT(A1,"d")" in the following formulas.

    Just to note, you will need to substitute "A1" for a cell reference governed by the range of values you wish to use the conditional formatting for. For example, if you wish to apply the following rules to the range "B3:D5" then you could use the cell reference "C4" in the following formulas, substituting it for "A1".

    Please add the rules in the following order:

    Conditional Formatting Rule 1, which works for numbers/days 4-9, by appending "th":

    Conditional Formula:  =AND(MOD(ABS(A1),10)>3,MOD(ABS(A1),10)<10)

    Number Format:         0"th"

    Conditional Formatting Rule 2, which works for number/day 0, by appending "th":

    Conditional Formula:  =MOD(ABS(A1),10)=0

    Number Format:         0"th"

    Conditional Formatting Rule 3, which works for number/day 1, by appending "st":

    Conditional Formula:  =MOD(ABS(A1),10)=1

    Number Format:         0"st"

    Conditional Formatting Rule 4, which works for number/day 2, by appending "nd":

    Conditional Formula:  =MOD(ABS(A1),10)=2

    Number Format:         0"nd"

    Conditional Formatting Rule 5, which works for number/day 3, by appending "rd":

    Conditional Formula:  =MOD(ABS(A1),10)=3

    Number Format:         0"rd"

    Conditional Formatting Rule 6, which works for numbers/days 11-13, by appending "th":

    Conditional Formula:  =AND(MOD(ABS(A1),100)>10,MOD(ABS(A1),100)<14)

    Number Format:         0"th"

    All done!

    Happy formatting!!

    Maria

    Sources:

    https://www.bcti.com/index.php/2017/06/30/excel-adding-ordinal-suffixes-list-numbers/

    https://www.techrepublic.com/blog/windows-and-office/pro-tip-add-an-ordinal-indicator-to-a-value-in-excel/

    http://www.meadinkent.co.uk/xltextabs.htm

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2017-11-16T13:47:47+00:00

    Okay so I've resolved this, for others who have this issue in future.

    First option:

    This will require two cells, type the number or date in A1 and change it using a formula in A2 which will return the ordinal number version of A1 in A2 (Of course, you can edit the formula to use other cell references).

    The formula below innately works for data in Number format, but if you wish to use the formula on a date then substitute "A1" for "DAY(A1)".

    Here's the formula:

    =A1&IF(AND(MOD(ABS(A1),100)>=10,MOD(ABS(A1),100)<=14),"th", CHOOSE(MOD(ABS(A1),10)+1,"th","st","nd","rd","th","th","th","th","th","th"))

    As this formula converts a cardinal number into ordinal text, to retrieve the number from the helper cell formula result of cell A2, please use the following formula:

    =LEFT(A2,LEN(A2)-2)

    Second option: (The better resolve, in my opinion, albeit more tedious to implement)

    This resolve requires use of conditional formatting and does not require a helper cell, as it will format each cell value governed by the conditional formatting rule without changing the stored data.

    If you wish to use the conditional formatting on Date values rather than Numbers, then substitute "A1" for "TEXT(A1,"d")" in the following formulas.

    Just to note, you will need to substitute "A1" for a cell reference governed by the range of values you wish to use the conditional formatting for. For example, if you wish to apply the following rules to the range "B3:D5" then you could use the cell reference "C4" in the following formulas, substituting it for "A1".

    Please add the rules in the following order:

    Conditional Formatting Rule 1, which works for numbers/days 4-9, by appending "th":

    Conditional Formula:  =AND(MOD(ABS(A1),10)>3,MOD(ABS(A1),10)<10)

    Number Format:         0"th"

    Conditional Formatting Rule 2, which works for number/day 0, by appending "th":

    Conditional Formula:  =MOD(ABS(A1),10)=0

    Number Format:         0"th"

    Conditional Formatting Rule 3, which works for number/day 1, by appending "st":

    Conditional Formula:  =MOD(ABS(A1),10)=1

    Number Format:         0"st"

    Conditional Formatting Rule 4, which works for number/day 2, by appending "nd":

    Conditional Formula:  =MOD(ABS(A1),10)=2

    Number Format:         0"nd"

    Conditional Formatting Rule 5, which works for number/day 3, by appending "rd":

    Conditional Formula:  =MOD(ABS(A1),10)=3

    Number Format:         0"rd"

    Conditional Formatting Rule 6, which works for numbers/days 11-13, by appending "th":

    Conditional Formula:  =AND(MOD(ABS(A1),100)>10,MOD(ABS(A1),100)<14)

    Number Format:         0"th"

    All done!

    Happy formatting!!

    Maria

    Sources:

    https://www.bcti.com/index.php/2017/06/30/excel-adding-ordinal-suffixes-list-numbers/

    https://www.techrepublic.com/blog/windows-and-office/pro-tip-add-an-ordinal-indicator-to-a-value-in-excel/

    http://www.meadinkent.co.uk/xltextabs.htm

    Was this answer helpful?

    0 comments No comments
  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Paul Edstein 82,871 Reputation points Volunteer Moderator
    2016-06-07T12:35:48+00:00

    If you read the first post in this thread, you will see that your 'solution' does not address the OP's needs:

    I am well aware of how to reformat numbers as text to create the ordinal number effect, but what I would like to do is have the numberdisplay as an ordinal number (e.g., "1st", "2nd", "3rd", etc.) while still retaining its numeric value (1, 2, 3, etc.).

    Furthermore, your 'solution' does not handle numbers ending in 11, 12, or 13, properly. To do that with a formula-based solution, try something like:

    =A1&MID("thstndrdth",MIN(9,2*RIGHT(A1)*(MOD(A1-11,100)>2)+1),2)

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2016-06-07T11:22:57+00:00

    use below formula;

    =A1&""&IF(MOD(A1,10)=0,"th",CHOOSE(MOD(A1,10),"St","nd","rd","th","th","th","th","th","th"))

    Was this answer helpful?

    0 comments No comments