Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

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.
doc month name to number 1

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 good idea3

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!
doc apply date format
 
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.

arrow blue right bubble   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:
doc month name to number 2

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:
doc month name to number 3

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:
doc month name to number 4

Tip: Using the above VBA may lose your original data, you can save them before you running the VBA code.


arrow blue right bubble   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:
doc month name to number 5

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:
doc month name to number 6

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").
doc month name to number 7

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:
doc month name to number 8

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.


arrow blue right bubble   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 installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)

1. Select the dates and click Kutools > Format > Apply Date Formatting. See screenshot:
doc apply date formatting 1

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.
doc apply date formatting 2

3. Then click Ok or Apply, you can see the dates have been converted to relative month names or month numbers.
doc apply date formatting 3

Click here to know more about Apply Date Formatting

arrow blue right bubble 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!
doc convert date
 
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.
Office Tab Enable Tabbed Editing and Browsing in Office, and Make Your Work Much Easier...
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
  • Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
  • More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words...
  • Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum...
  • Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns...
  • Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Create Mailing List and Send Emails by Cell's Value...
  • Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
  • More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

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!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    M BAMAGA · 2 years ago
    wf = one week from now
    mf= one month from the entry
    2mf= 2 months from the entry
    4mf= 4 months from the entry
    6mf= 6 months from the entry
    yf= one year from the entry
    I am wondering if possible to covert this entry in another column as due dates.
  • To post as a guest, your comment is unpublished.
    Nihar Panda · 3 years ago
    If you pre-filling the month names, did you try using a vlookup instead of using a VBA?
  • To post as a guest, your comment is unpublished.
    maharba · 4 years ago
    Thank you It works in my case
  • To post as a guest, your comment is unpublished.
    Rakesh Sharma · 4 years ago
    This is funny. Following Function converts the Filename which is Month Name to its corresponding Numerical value


    =MONTH(1&LEFT((MID(CELL("filename",A1),SEARCH("[",CELL("filename",A1))+1,SEARCH(".",CELL("filename",A1))-1-SEARCH("[",CELL("filename",A1)))),3))
  • To post as a guest, your comment is unpublished.
    curious · 5 years ago
    Excel function MONTH: does it get the number from text for example from NOV it would get 11, or: the text from the number for example from 11 it would get NOV, or what? On my location it goes from 11 to 11, not very interesting!!