How to convert month name to number in Excel?
Sometimes, you may want to convert the month name to number or the number to month name, such as convert January to 1, in Excel, you can use formulas and VBA to quickly convert between month name and number.
Convert month name to number in Excel
Convert number to month name with VBA
Convert date to month name or month number with Kutools for Excel
Convert month name to number in Excel
There are two ways that can help you to convert month names to numbers in Excel.
Method 1: Convert month name to number with formula.
Type this formula =MONTH(DATEVALUE(A1&" 1")) ( A1 indicates the cell that you want to convert the month name to number, you can change it as you need) into a blank cell, and press Enter key. See screenshot:
If you want to convert a column list of month names to numbers, just drag the fill handle of the formula cell to fill the range you need. See screenshot:
Method 2: Convert month name to number with VBA
1. Hold ALT button and press F11 on the keyboard to open a Microsoft Visual Basic for Application window.
2. Click Insert > Module, and copy the VBA into the module.
VBA: Convert month name to number
Sub ChangeNum()
'Updateby20140311
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
If Rng.Value <> "" Then
Rng.Value = Month(DateValue("03/" & Rng.Value & "/2014"))
End If
Next
End Sub
3. Click Run to run the VBA code, and a KutoolsforExcel dialog pops up for you to select a range of cells with month names that you want to convert to numbers, then click OK, the selecetd month names have been converted to month numbers. See screenshot:
Tip: Using the above VBA may lose your original data, you can save them before you running the VBA code.
Quickly and easily convert date to other date formatting in Excel
|
Have you ever tried to convert a date to day, month or year only? The formulas maybe hard to remember, but the Apply Date Formatting of Kutools for Excel can quickly convert a standard date to the date formatting as you need as below screenshot shown. Dont, waite, click for 30 days free trial! |
![]() |
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. |
Convert number to month name with VBA
In reverse, if you want to convert numbers to month names, you also can use two methods to solve it.
Method 1: Convert number to month name with formula.
Type this formula =TEXT(DATE(2000,A1,1),"mmmm") ( A1 indicates the cell that you want to convert the number to month name, you can change it as you need) into a blank cell, and press Enter key. See screenshot:
If you want to convert a column list of numbers to month names, just drag the fill handle of the formula cell to fill the range you need. See screenshot:
Tip: If you want to convert number to the abbreviation of the month name, you can use this formula =TEXT(DATE(2000,A1,1),"mmm").
Method 2: Convert number to month name with VBA
1. Hold ALT button and press F11 on the keyboard to open a Microsoft Visual Basic for Application window.
2. Click Insert > Module, and copy the VBA into the module.
VBA: Convert number to month name
Sub ChangeMonth()
'Updateby20140311
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
Rng.Value = VBA.Format(Rng.Value * 29, "mmmm")
Next
End Sub
3. Click Run to run the VBA code, and a KutoolsforExcel dialog pops up for you to select a range of cells with numbers you want to convert to the month names. Then click OK, the numbers have been converted to corresponding month names. See screenshot:
Tip:
1. Using the above VBA may lose your original data, you can save them before you running the VBA code.
2. If you want to convert number to the abbreviation of the month name, you can change "mmmm" to "mmm" in the above VBA.
Convert date to month name or month number with Kutools for Excel
If you have a list of dates in a worksheet needed to convert to month name or month number, in this case, you can apply Kutools for Excel’s Apply Date Formatting utility.
Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. | ||
After free installing Kutools for Excel, please do as below:
1. Select the dates and click Kutools > Format > Apply Date Formatting. See screenshot:
2. Then in the popped out dialog, select the date format you need from the Date formatting list, and you can see the result from the Preview pane.
3. Then click Ok or Apply, you can see the dates have been converted to relative month names or month numbers.
Click here to know more about Apply Date Formatting
Convert date to month number or month name or other date formats
Quickly convert nonstandard date to standard date formattiing(mm/dd/yyyy)
|
In some times, you may received a workhseets with multiple nonstandard dates, and to convert all of them to the standard date formatting as mm/dd/yyyy maybe troublesome for you. Here Kutools for Excel's Conver to Date can quickly convert these nonstandard dates to the standard date formatting with one click. Click for free full featured trial in 30 days! |
![]() |
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. |
Best Office Productivity Tools
Supercharge Your Spreadsheets: Experience Efficiency Like Never Before with Kutools for Excel
Kutools for Excel boasts over 300 features, ensuring that what you need is just a click away...
Supports Office/Excel 2007-2021 & newer, including 365 | Available in 44 languages | Enjoy a full-featured 30-day free trial.
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!







