#1   Report Post  
Posted to microsoft.public.excel.misc
davids
 
Posts: n/a
Default Date Function

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
davesexcel
 
Posts: n/a
Default Date Function


http://tinyurl.com/z6qpd
Here's a post I hope will help you


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=523354

  #3   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default Date Function


Perhaps you only need up to 31 but this formula will convert an integer
in A1 to an ordinal number

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


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=523354

  #4   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben
 
Posts: n/a
Default Date Function


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 = "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 MS Excel MVP

On Thu, 16 Mar 2006 15:51:27 -0800, davids
wrote:

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?


  #5   Report Post  
Posted to microsoft.public.excel.misc
Theo
 
Posts: n/a
Default Date Function

?B?ZGF2aWRz?= wrote in
:

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?




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


  #6   Report Post  
Posted to microsoft.public.excel.misc
davesexcel
 
Posts: n/a
Default Date Function


davids Wrote:
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?

It helps if you acknowlege the replies


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=523354

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
Date function in Excel that updates only when a doc is changed? torino0020 Excel Worksheet Functions 1 January 5th 06 03:00 AM
Date Function Khangura Excel Discussion (Misc queries) 1 December 21st 05 09:33 AM
date format and the RIGHT function Rich Hayes Excel Worksheet Functions 0 December 19th 05 11:06 AM
Date function Dee Excel Worksheet Functions 2 July 13th 05 03:32 PM
Is there a function to show future date taxmom Excel Worksheet Functions 2 March 4th 05 09:23 PM


All times are GMT +1. The time now is 09:12 AM.

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"