Convert Month to Number

October 19, 2009 at 02:37:20
Specs: Windows 24.08.2009
I have this formula =(mmmm2num($C$4)) for example C4 is Feb, and would like my return to be 2. But this is giving me error #NAME? Is there any easy way out. Thanks

See More: Convert Month to Number

Report •

October 19, 2009 at 04:33:29
Where did you get mmmm2num from?

Excel is returning #NAME because it does not recognize the function. It is not a built in Excel function so you would need to have a User Defined Function (UDF) stored in a VBA module for it to work.

In any case, try this:


Report •

October 19, 2009 at 04:47:42
Works for me.


Report •

October 19, 2009 at 05:05:20

You should also consider whether you want to store months (e.g. Feb in C4) as text.

Without knowing anything about your proposed application it is not possible to decide whether this is the best approach.

If you are using real dates in your application, you can enter a date, such as 01/Feb/2009 in a cell. Excel will recognize it as a date and then you can format the cell with "mmm" and it will show Feb.

Format with "mmmm" and the cell will show February, or
Format with "mm" and it will show 2, - no formula required.

The formula DerbyDad03 gave you works by making Excel think there is a date '1Feb' which it converts to 01 Feb 2009 and then returns the month number (2).
Try =YEAR(1&C4) and you get 2009.

So you may be better off starting with a real date in C4.


Report •

Related Solutions

Ask Question