Is there a function I could use that would change a column of 1,2,3,4 etc
into a column of 1st,2nd,3rd,4th etc?
tinyurl.com/z6qpd
Here's a post I hope will help you--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: www.excelforum.com/member.php...oamp;userid=31708
View this thread: www.excelforum.com/showthread...hreadid=523354
Perhaps you only need up to 31 but this formula will convert an integer
in A1 to an ordinal number
=A1amp;IF(OR(MOD(A1,100)={11,12,13}),quot;thquot;,CHOOSE(MIN( MOD(A1,10) 1,5),quot;thquot;,quot;stquot;,quot;ndquot;,quot;rdquot;,quot;thquot;))--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: www.excelforum.com/member.php...oamp;userid=30486
View this thread: www.excelforum.com/showthread...hreadid=523354
davids
Copy this UDF to a general module in your workbook.
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 = quot;stndrdththththththquot; ' 2 char suffixes
n = Num Mod 100
If ((Abs(n) gt;= 10) And (Abs(n) lt;= 19)) _
Or ((Abs(n) Mod 10) = 0) Then
OrdinalNumber = Format(Num) amp; quot;thquot;
Else
OrdinalNumber = Format(Num) amp; Mid(cSfx, _
((Abs(n) Mod 10) * 2) - 1, 2)
End If
End FunctionGord Dibben MS Excel MVP
On Thu, 16 Mar 2006 15:51:27 -0800, davids gt;
wrote:
gt;Is there a function I could use that would change a column of 1,2,3,4 etc
gt;into a column of 1st,2nd,3rd,4th etc?=?Utf-8?B?ZGF2aWRz?= gt; wrote in
:
gt; Is there a function I could use that would change a column of 1,2,3,4
gt; etc into a column of 1st,2nd,3rd,4th etc?
gt;
Try this one:
A1: 1st
B1: 2nd- select A1 B1.
- Klick south-east corner and drag to C3, D3, E3....
Should result in:
row A1, B1, C1, etc...
1st 2nd, 3rd,etc..
--
Greetz, Just4fun
davids Wrote:
gt; Is there a function I could use that would change a column of 1,2,3,4
gt; etc
gt; into a column of 1st,2nd,3rd,4th etc?
It helps if you acknowlege the replies--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: www.excelforum.com/member.php...oamp;userid=31708
View this thread: www.excelforum.com/showthread...hreadid=523354
- Feb 22 Thu 2007 20:35
Date Function
close
全站熱搜
留言列表
發表留言