0

I've got a month number. By typing in the immediate editor MonthName(11,True) I get the result NOV. What would be the inverse of this function? e.g. I've got SEP and I want by typing function(SEP) the number 9 as an Output

Community
  • 1
  • 1
Bython
  • 1,135
  • 1
  • 12
  • 21
  • Already answered [here](http://stackoverflow.com/questions/11895228/excel-vba-convert-month-name-into-number) – z̫͋ Jul 28 '14 at 13:58

1 Answers1

3

You are looking for this:

Sub Sample()
    Dim MonthNm As String
    MonthNm = "September"
    Debug.Print Month(DateValue("01 " & MonthNm & " 2014"))
End Sub

or in small:

=MONTH(DATEVALUE(A1&"9"))

Also check How to convert month name to number in Excel?

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331