I am trying to take the name of a month, such as October and turn that into the corresponding number for that month 10. Past making a long formula that checks for each month by string, and without using apps script to create a custom function (not reliable enough).

How would I do this?


If cell A1 contains the name of the month, then the command

=month(datevalue(A1&" 1"))

returns the number of the month. It appends a day to the month (1), so that datevalue can parse the date; then month returns the month number.

  • Nice! Does this work in locales that format dates differently? – Jerry101 Oct 25 '15 at 4:11
  • Datevalue takes locale and language into account when parsing strings. But I think that October 1 is unambiguous... assuming English language, which is given in the problem. To have completely self contained solution, I would use a helper table and Vlookup function. – user79865 Oct 25 '15 at 4:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.