On 17/02/2008 01:10, Brian Barker wrote:
At 00:07 17/02/2008 +0000, Harold Fuchs wrote:
On 16/02/2008 22:56, Brian Barker wrote:
At 17:24 16/02/2008 -0500, Kenn Goutal wrote:
It appears that, in my version at least, there is no function that, given a number 1..12, returns the name of the corresponding month.

Try =TEXT(A1*30;"MMMM").

Please, why the "*30"? It works, but why?

We need to create a date in the appropriate month in order for the TEXT() function to be able to work on it. And you will know that dates are stored internally as the number of days after 30 December 1899. If we multiply by 30, 1 maps to 30, i.e. 29 January 1900, 2 maps to 60, i.e. 28 February 1900, and so on up to 12, which gives 360, or 25 December 1900. I fact, we could use 29 or 28 instead: 28 gives dates from 27 January 1900 to 1 December 1900. Anything greater than 30 spills over into the wrong months after January, and 27 doesn't make it into September properly (or beyond).

It occurs to me now (though I confess it didn't before) that the correct functioning of this technique might depend on the setting at Tools | Options... | OpenOffice.org Calc | Calculate | Date. But I find now that it happens that it works similarly (with multipliers from 27 to 30) for all three choices of the reference date.

Brian Barker

Yes, of course; thank you.

--
Harold Fuchs
London, England
Please reply *only* to users@openoffice.org


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to