Convert Month Name to Number – Excel & Google Sheets
Written by
Reviewed by
Download the example workbook
This tutorial will demonstrate how to convert a month name to it’s corresponding number in Excel and Google Sheets.
Convert Month Name to Number
The first question to ask yourself when converting a month name to a number is: Is my month name stored as text?
If your month name is stored as text you can use the MONTH and DATEVALUE Functions to convert the month name, but if the month isn’t stored as text than you only need to adjust the formatting.
Month Name to Number – Formatting
If the cell containing the month name is right-aligned then the cell may contain a date (stored as a serial number) with cell number formatting set to month:
Simply change the date format from MMM (abbreviated name) or MMMM (full name) to M (month number, no leading zero) or MM (month number, with leading zero).
You can change the date format from the Cell Formatting Menu:
Type “M” or “MM” in the Type area.
To access the Cell Formatting Menu use shortcut CTRL + 1 or press this button:
Month Name to Number – Functions
If your month name is stored as text then you can use this formula containing MONTH and DATEVALUE to calculate the month number:
=MONTH(DATEVALUE(B3&"1"))
Convert Month Name to Number in Google Sheets
All of the above examples work exactly the same in Google Sheets as in Excel.