Not sure what you're getting at Pete.
Please expand. Remember.....I'm getting very long in the tooth<g>
Gord
I took SJ's request to mean always start at the 1st of each month so I
hard-coded the "1st"
If the start date is to be changed also and the two dates are in A1(start) and
A2(current), re-write as
="Receipts from: " & ordinalnumber(DAY(A1)) & " to " & ordinalnumber(DAY(A2)) &
" of " &TEXT(A1,"mmmm")
Gord
>Not sure what you're getting at Pete.
>
[quoted text clipped - 40 lines]
>>> >Thanks
>>> >SJ
Gord Dibben MS Excel MVP
Pete_UK - 05 Oct 2006 22:53 GMT
SJ emailed me directly to say:
> Thanks Pete!
>
[quoted text clipped - 4 lines]
>
> SJ
So he got something out of it. I suggested that he continues to monitor
the thread.
Pete
> I took SJ's request to mean always start at the 1st of each month so I
> hard-coded the "1st"
[quoted text clipped - 53 lines]
>
> Gord Dibben MS Excel MVP
Gord Dibben - 05 Oct 2006 23:04 GMT
Thanks for the update Pete.
I take these requests too literally sometimes.
If SJ wants the "5th of October" we'll give it to him/her.
Gord
>SJ emailed me directly to say:
>
[quoted text clipped - 69 lines]
>>
>> Gord Dibben MS Excel MVP
I realise now (having looked at it in a bit more detail) that your
function will apply to numbers other than dates, which are limited to a
maximum of 31, but I was thinking along these lines when I posted (I've
just amended your UDF - hope you don't mind):
Function OrdinalNum(ByVal Num As Long) As String
Dim n As Long
Const cSfx =
"stndrdthththththththththththththththththstndrdthththththththst"
n = Num Mod 100
OrdinalNum = Format(Num) & Mid(cSfx, (Abs(n) * 2) - 1, 2)
End Function
>From this you can just get the appropriate pair of letters directly,
without the complex IF, though it is limited to a maximum value of 31.
It seems as if you have teeth left <bg>
Pete
> Not sure what you're getting at Pete.
>
[quoted text clipped - 40 lines]
> >> >Thanks
> >> >SJ
Gord Dibben - 05 Oct 2006 23:03 GMT
Pete
OrdinalNumber is one of Chip Pearson's constructs.
http://www.cpearson.com/excel/ordinal.htm
Yes, the original was to give an ordinal for any number, not just dates.
Gord
>I realise now (having looked at it in a bit more detail) that your
>function will apply to numbers other than dates, which are limited to a
[quoted text clipped - 60 lines]
>> >> >Thanks
>> >> >SJ