Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
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

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:
=MONTH(1&C4)

Hi,
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.
Regards

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |