Skip to main content

3 easy methods to convert month name to number in Excel

Author: Sun Last Modified: 2025-04-16

In Excel, there are times when you need to convert month names to their corresponding numbers to facilitate data analysis and processing. This tutorial will cover three methods to convert month names to numbers: using a formula, using Kutools for Excel, and using VBA code. Whether you are a beginner or an experienced Excel user, these methods will help you enhance your productivity.

A screenshot showing a list of month names to convert to numbers in Excel


Convert month name to number in Excel

This section covers three methods to convert month names to numbers: using a formula, using Kutools for Excel, and using VBA code. Each method is tailored to cater to different user preferences and technical capabilities, ensuring flexibility and ease of use across various Excel scenarios.

Use formula to convert month name to number in Excel

Using a formula is a simple and flexible way to convert month names to numbers. Excel's built-in formula functions are powerful, allowing us to create a formula that automatically converts month names. Let's walk through the steps to achieve this.

Type the following formula into a blank cell, and press the Enter key. Then, select the formula cell and drag its Fill Handle down to apply it to the rest of the range.

=MONTH(A2&1)

A screenshot of the formula converting month names to numbers in Excel using a formula

Easily convert date to corresponding month number with Kutools

If you want to convert an entire date to its corresponding month name and prefer a simpler approach, Kutools for Excel is a highly useful tool. It's "Apply Date Formatting" features can simplify your workflow. Here are the steps to convert dates to corresponding month numbers using Kutools for Excel.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...
  1. Select the dates you want to convert to month number, then select "Kutools" > "Format" > "Apply Date Formatting".
  2. In the pop-up "Apply Date Formatting" dialog box, choose the "03" option in the "Date format list", and then click "OK".
    You can preview the results in real time in the "Preview" pane.
    A screenshot of the Apply Date Formatting dialog box in Kutools for Excel
Result

All dates in the selected range have been converted to corresponding month names immediately.

A screenshot showing dates converted to corresponding month numbers in Excel

Note: To use this feature, you should have Kutools for Excel installed on your computer. Go to download Kutools for Excel now.

Use VBA code to convert month name to number in Excel

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 code: 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, and the selected month names will be converted to month numbers. See screenshot:
A screenshot showing VBA code results for converting month names to numbers in Excel

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


Convert date to month number or month name or other date formats using Kutools for Excel

 
Kutools for Excel: Over 300 handy tools at your fingertips! Enjoy permanently free AI features! Download Now!

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


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!