Function to return a month name from a number (1-12) that is not a

C

Chuck M

Hi,
I need to return the month name (Jan, Feb, etc.) from a number (1-12).
However the number is not a date. I know can set up a range containing the
month names and do a vlookup but I was wondering if there is a more compact
and effecient way to do this with a function.
 
N

Niek Otten

Hi Chuck,

=TEXT(DATE(0,A1,1),"mmmm")

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| Hi,
| I need to return the month name (Jan, Feb, etc.) from a number (1-12).
| However the number is not a date. I know can set up a range containing the
| month names and do a vlookup but I was wondering if there is a more compact
| and effecient way to do this with a function.
|
| --
| TIA
| Chuck M.
 
P

Pete_UK

You could use this function:

=CHOOSE(A1,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

where A1 contains a number 1 - 12.

Hope this helps.

Pete
 
M

Mike H

One way

=TEXT(1*29,"mmmm") Note the 1 could be a cell reference

Another way
=CHOOSE(1,"January","Febuary","March","April","May","June","July","August","September","October","November","December")

And lastly with a table

1 Jan
2 Feb
etc
=VLOOKUP(1,A1:B12,2,FALSE)

Mike
 
C

Chuck M

Thanks Toppers, Niek, Mike and Pete. The responses are greatly appreciated!
--

Chuck M.


Pete_UK said:
You could use this function:

=CHOOSE(A1,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

where A1 contains a number 1 - 12.

Hope this helps.

Pete
 
P

Pete_UK

The problem with any of the methods that rely on a date format is that
you don't have much control over what is returned - either Jan, Feb,
Mar (with a format of mmm), or January, February, March (with mmmm).
If the OP wanted JAN, FEB, MAR (although admittedly he didn't ask for
this) then he could use UPPER around the TEXT formulae, or specify
this in the CHOOSE formulae, but you don't have this choice with pure
formatting.

I like your lateral thinking, though, Roger, relying on the date bug
for Feb 1900 - well done!

Pete
 
Top