ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Function that returns the month name (https://www.excelbanter.com/excel-worksheet-functions/127464-function-returns-month-name.html)

Rapunzel

Function that returns the month name
 
How can I create a function that returns the month name given only the number
of the month (1-12)? I do not want to lookup a separate table inside my
worksheet.

Leo Heuser

Function that returns the month name
 
Followup to newsgroup only please.
"Rapunzel" skrev i en meddelelse
...
How can I create a function that returns the month name given only the
number
of the month (1-12)? I do not want to lookup a separate table inside my
worksheet.


Here's one way:

Assuming month number in A2, enter

=DATE(,A2+1,)

in e.g. B2. Format B2 as "mmmm" without quotes.


--
Best regards
Leo Heuser



T. Valko

Function that returns the month name
 
Try this:

For the short month: Jan, Feb, Mar, etc

=TEXT(A1*30,"mmm")

For the long month: January, February, March, etc

=TEXT(A1*30,"mmmm")

You might want to make it a little more robust by checking that A1 does in
fact contain a number from 1 to 12:

=IF(AND(A1=1,A1<=12),TEXT(A1*30,"mmm"),"")

Biff

"Rapunzel" wrote in message
...
How can I create a function that returns the month name given only the
number
of the month (1-12)? I do not want to lookup a separate table inside my
worksheet.





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com