MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Return month (text) based on month (number) in another cell


Posted by Dwight on August 20, 2001 7:32 AM

In cell A2 is a number which corresponds to a month (1=January, 2=February, and so on). I want a formula in A1 which will yield the name of the month indicated in A2 (ie, if A2 is 3, A1 which show "March"). Tried formatting A1 as custom "mmmm" with formula "=A2", but for some reason this yielded "January" no matter what number was in A2.
Any ideas?


Posted by Alix on August 20, 2001 7:46 AM

Posted by Alix on August 20, 2001 7:48 AM

Ignore last one...


Have you thought of using a vlookup instead?
Alix

Posted by Aladin Akyurek on August 20, 2001 8:27 AM

In A1 enter: =CHOOSE(A2,"January","February","March","April","May","June","July","August","September","October","November","December")

or, as Alix suggested,

=VLOOKUP(A2,{1,"January";2,"February";3,"March";4,"April";5,"May";6,"June";7,"July";8,"August";9,"September";10,"October";11,"November";12,"December"},2)

Aladin

Posted by Russell Hauf on August 20, 2001 8:35 AM

Yet another way....

You could also use the formula:

=DATE(1,A2,1)

And format it "mmmm"

Posted by Dwight on August 20, 2001 9:00 AM

All worked. Thanks, guys. EOM