Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 538
Default formatting numbers as 1st 2nd

chiacheng.teg wrote:

On Friday, February 13, 2009 at 5:10:01 AM UTC+8, Bob Arnett wrote:
Is there any way to display numbers in the mode of:
1st
2nd
3rd
4th
etc. ?


Did you not notice that the original post was ***NINE ****ING YEARS AGO***?!
****ing Google Groupies. I wish Google would disable replies after a few days
of no activity.

Or a primitive but simple solution that works:

=day&vlookup(day,vlookup_table,2,false)


A solution that doesn't require manual entry of every number in existence:

=A1&IF(OR(AND(A13,A1<21),A1=0),"th",VLOOKUP(MOD(A 1,10),vlookup_table,2))

....which only requires a 5-line lookup table:

1 st
2 nd
3 rd
4 th
* th

....or, you know, the shorter and much better solution provided by Rick
Rothstein 16 minutes after the original post -- again, ***NINE YEARS AGO***:

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

--
You think you have won. We shall see about that.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting Numbers Jayant Gedam Excel Discussion (Misc queries) 1 October 27th 07 05:58 PM
Formatting Numbers Peledon New Users to Excel 3 April 11th 07 06:04 PM
Formatting numbers KC8DCN Excel Discussion (Misc queries) 2 May 24th 06 05:53 AM
formatting numbers Pascale Excel Discussion (Misc queries) 2 January 24th 06 11:05 AM
Formatting numbers avjunior Excel Discussion (Misc queries) 7 October 25th 05 07:47 PM


All times are GMT +1. The time now is 01:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"