LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 22,906
Default JOINING OF TEXT & DATE

Not sure what you're getting at Pete.

Please expand. Remember.....I'm getting very long in the tooth<g


Gord

On 5 Oct 2006 13:35:07 -0700, "Pete_UK" wrote:

Hi Gord,

why not just make the string cSfx 62 characters long with all the
suffixes for 1 to 31 contained within it, and then pick the appropriate
pair?

Pete

Gord Dibben wrote:
With a UDF and this formula..........

="Receipts from: 1st to " & ordinalnumber(DAY(A1)) & " of " &TEXT(A1,"mmmm")

Function OrdinalNumber(ByVal Num As Long) As String
Dim n As Long
Const cSfx = "stndrdthththththth"
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, 5 Oct 2006 15:17:13 -0400, "SJ" wrote:

Hello!

Text = "Receipts from:"
Date = 10/5/06. (This date will in a different cell and will change every
month)

The decription I desire will be: "Receipts from: "1st to 5th October" or any
variation thereof as long as it shows the period

Thanks
SJ


 
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
About Text to Date Sameer Excel Discussion (Misc queries) 5 October 6th 06 01:03 PM
turn off convert text to date (i.e. 4-9 to April 9, 2006) [email protected] Excel Worksheet Functions 4 June 13th 06 04:25 PM
How do I grab the date from a text string? [email protected] Excel Worksheet Functions 4 June 6th 06 07:55 AM
Macro to convert text to date Nortos Excel Worksheet Functions 2 May 11th 05 10:42 AM
EXTRACT TEXT FROM A DATE Ronbo Excel Worksheet Functions 5 February 1st 05 07:39 AM


All times are GMT +1. The time now is 01:33 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"