Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
John
 
Posts: n/a
Default Format of Numbers Q

Is there any way to Format numbers like this

1st
2nd
3rd
4th

etc, etc, etc


Thanks


  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Not formatting, but take a look at
http://www.xldynamic.com/source/xld.RANK.html

--

HTH

RP
(remove nothere from the email address if mailing direct)


"John" wrote in message
...
Is there any way to Format numbers like this

1st
2nd
3rd
4th

etc, etc, etc


Thanks




  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

How about a UDF?

Function OrdinalNumber(ByVal Num As Long) As String
'You can call this directly from a worksheet cell, as follows:
'=OrdinalNumber(A1)
Dim N As Long
Const cSfx = "stndrdthththththth" ' 2 char suffixes

N = Num Mod 100
If ((Abs(N) = 10) And (Abs(N) <= 19)) _
Or ((Abs(N) Mod 10) = 0) Then
OrdinalNumber = Format(Num) & "th"
Else
OrdinalNumber = Format(Num) & Mid(cSfx, _
((Abs(N) Mod 10) * 2) - 1, 2)
End If

End Function


Gord Dibben Excel MVP

On Sat, 4 Dec 2004 21:39:21 -0000, "John" wrote:

Is there any way to Format numbers like this

1st
2nd
3rd
4th

etc, etc, etc


Thanks


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
Format numbers in chart datatable MB Charts and Charting in Excel 3 May 29th 05 03:37 PM
entering numbers to display a time format Ian Williams/Eazygig Excel Discussion (Misc queries) 1 January 10th 05 11:57 AM
how can i type the numbers in arabic or farsi format مثل 1233 zari Excel Discussion (Misc queries) 0 January 4th 05 05:37 AM
Mail Merge - format of numbers Rita Halporn Excel Discussion (Misc queries) 4 December 26th 04 01:19 AM
How do i change numbers in text format to number format? Greg New Users to Excel 1 December 14th 04 05:22 PM


All times are GMT +1. The time now is 09:39 PM.

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

About Us

"It's about Microsoft Excel"