WPS Office

Free All-in-One Office Suite with PDF Editor

correct-icon

Edit Word, Excel, and PPT for FREE.

correct-icon

Read, edit, and convert PDFs with the powerful PDF toolkit.

correct-icon

Microsoft-like interface, easy to use.

Free download

Windows • MacOS • Linux • iOS • Android

banner

How to add month name from date in Excel formula

July 22, 2022
50.1K Views

Excel has lately gained popularity as it enables the users to organize data in meaningful categories and due to its advance features. This article holds a collection of formulas and methods to get month names and its goal is to display month name from any given data. Sometimes, when working with date-related data, you may want to add month name in Excel to number or the number to month name, such as convert January to 1, in Excel, you can use formulas to quickly convert between month name and number.There are various methods to add month names in excel some of which are listed below:

Extracting Month Name from Date in Excel:

Follow these steps to add month name in Excel:

In case you want to get a month name rather than a number, you use the TEXT function in Excel.

  1. =TEXT(A2, mmm)- shifts an abbreviated month name, as Jan - Dec

  2. =TEXT(A2,mmmm)- returns a full month name, as January - December.

You don’t need any formulae if you don’t want to convert date to month in your spreadsheet, rather you wish to only display month name instead of full date.

  1. Select the cell in which you have written all the dates

  2. Then press Ctrl+1 so that the format cells dialog will appear.

  3. Next, click number and then select customs and type either”mmm”or “mmmm” to get shortened or complete name respectively. In this case, your entries will be able to get used in further computations and activities.

How to Convert Month Number to Month Name in Excel:

Follow these steps to add month name in Excel:

If  you have a list of numbers (1 till 12) in your Spreadsheet that you want to convert to month names. To do this, you can use any of the following formulas:

To return an abbreviated month name (Jan - Dec), you can use the method listed below:

=TEXT(A2*28, mmm)

=TEXT(DATE(2015, A2, 1), mmm)

To return a full month name (January - December), you may use the method listed below:

=TEXT(A2*28, mmmm)

=TEXT(DATE(2015, A2, 1), mmmm)

In above formulas, A2 is a cell with a month number. And the only real difference between the formulas is the month codes:

  1. mmm - shortened name of the month, such as Aug - Dec

  2. mmmm - complete month name

  3. mmmmm - first letter of the month name

When used in combination with a month format code such as mmm or mmmm, Excel considers the number 1 to be the first day of January 1900. Multiply 1, 2, 3, etc. by 28 to get the 28th, 56th and 84th day of year 1900 which are in January, February, March, etc. The mmm or mmmm format code displays only the name of the month.

Converting Month Name to Number in Excel:

Follow these steps to add month name in Excel:

There are two Excel functions that can help you convert month names to numbers - DATEVALUE and MONTH. Excel's DATEVALUE function converts a date stored as text to a serial number that Microsoft Excel recognizes as a date. And then, the MONTH function extracts a month number from that date.

The complete formula is as follows:

=MONTH(DATEVALUE(D1 “1”))

Type this formula =MONTH(DATEVALUE(D1& 1)) ( D1 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 attached below:

How to Convert month name to numeric text in Excel?

In Excel, you may encounter situations where you need to convert month names to their corresponding numeric representation. Fortunately, Excel provides useful functions such as DATEVALUE and MONTH to help you achieve this. Let's walk through the steps:

Assuming you have a month name, such as "February," in cell A1, enter the following formula in an adjacent cell (e.g., B1) to convert the month name to a date:

code function in excel

This formula concatenates the month name with "1" and a constant year (e.g., 2023) to create a valid date format.

Press Enter to apply the formula. Excel will convert the month name "February" to the corresponding date value, such as "02/01/2023." Note that the day is set as "1" for simplicity.

In another cell (e.g., C1), use the MONTH function to extract the month number from the date:

code function in excel

This formula will extract the month number (in this case, "2") from the converted date value in cell B1.

By combining the DATEVALUE function to convert the month name to a date and the MONTH function to extract the month number, you can easily convert month names to their numeric representation.

Example 4. How to calculate the number of days based on the number of months?

In Excel, you may need to calculate the number of days based on a given number of months. To achieve this, you can use the EDATE and DAY functions. Let's go through the steps:

Assume you have the number of months in cell A1, for example, "5".

In an adjacent cell, such as B1, use the following formula to calculate the end date:

code function in excel

This formula uses the EDATE function to calculate the end date by adding the number of months in cell A1 to the current date (TODAY()).

Press Enter to apply the formula. Excel will display the end date based on the number of months provided. For example, if today's date is June 25, 2023, and cell A1 contains "5", the formula will calculate the end date as November 25, 2023.

code function in excel

This formula subtracts the day value of the current date (TODAY()) from the day value of the calculated end date in cell B1.

Press Enter to apply the formula. Excel will display the number of days between the start date (today) and the end date based on the given number of months.

How to get the number of days in a month based on a date

In Excel, you may need to determine the number of days in a specific month based on a given date. To accomplish this, you can utilize the EOMONTH and DAY functions. Let's walk through the steps:

Assume you have a date value in cell A1, such as "June 15, 2023".

In an adjacent cell, such as B1, use the following formula to calculate the last day of the month for the given date:

code function in excel

This formula utilizes the EOMONTH function, which stands for "End of Month," to calculate the last day of the month based on the date in cell A1.

Press Enter to apply the formula. Excel will display the last day of the month corresponding to the given date. For example, if cell A1 contains "June 15, 2023," the formula will calculate the last day of June as "June 30, 2023".

To obtain the number of days in the month, use the following formula in another cell, such as C1:

code function in excel

This formula extracts the day value from the calculated last day of the month in cell B1.

Press Enter to apply the formula. Excel will display the number of days in the month based on the given date.

By leveraging the EOMONTH function to find the last day of the month and the DAY function to extract the day value, you can easily determine the number of days in a specific month based on a given date.

The Best Office Software WPS Office

WPS office landing page screenshot

WPS Office is a powerful office productivity suite that includes word processing, spreadsheet, and presentation applications. It offers a wide range of features and functionalities comparable to other leading office software options. Whether you are a student, professional, or business user, WPS Office provides a versatile platform for all your document-related tasks.

WPS Office: Use Word, Excel, and PPT for FREE, No Ads.

Key Features and Benefits

  • Writer: WPS Writer is the word processing component of WPS Office. It offers a user-friendly interface with a plethora of formatting options, templates, and advanced editing tools. With compatibility for various file formats, including Microsoft Word documents, WPS Writer ensures seamless document sharing and collaboration.

  • Spreadsheets: WPS Spreadsheets provides a robust and intuitive spreadsheet solution. It offers a comprehensive set of formulas, functions, and data analysis tools, making it suitable for complex data manipulation, financial calculations, and statistical analysis. Its support for pivot tables, charts, and conditional formatting empowers users to visualize data effectively.

  • Presentations: WPS Presentation enables the creation of dynamic and captivating slideshows. With a variety of templates, transition effects, and multimedia integration options, it allows users to deliver engaging presentations. The presenter view, slide master, and collaboration features enhance productivity and facilitate seamless teamwork.

  • Compatibility: WPS Office is designed to ensure compatibility with Microsoft Office formats, including DOCX, XLSX, and PPTX. This compatibility makes it convenient for users to work with files created in other popular office software, minimizing any compatibility issues.

  • Mobile Support: WPS Office offers mobile applications for Android and iOS devices, enabling users to work on their documents on the go. The mobile apps provide a similar user experience and feature set as the desktop version, ensuring productivity regardless of the device being used.

FAQs About month formula in excel

Q1: Why is the month function not working in sheets?

A1: The MONTH function may not work if the date format is incorrect or if the cell containing the date is not recognized as a valid date. Ensure that the date format is consistent and use the proper syntax in the formula.

Q2: How do I get the month from a date in Excel?

A2: To extract the month from a date in Excel, you can use the MONTH function. Simply enter the formula "=MONTH(date)" where "date" represents the cell reference or a specific date value. The function will return the numeric representation of the month (1 for January, 2 for February, and so on).

Q3: How do I extract the month and year from a date in Excel?

A3: To extract both the month and year from a date in Excel, you can use a combination of the MONTH and YEAR functions. Enter the formula "=MONTH(date) & "-" & YEAR(date)" where "date" represents the cell reference or a specific date value. This will return the month and year in the format "month-year" (e.g., "6-2023" for June 2023).

Final Thought on functions in Excel

In conclusion, mastering the use of the month formula in Excel opens up a world of possibilities for data analysis and reporting. With this formula, you can effortlessly extract the month from a given date, enabling you to organize and analyze data based on monthly trends. Throughout this article, we explored various aspects of using the month formula, including extracting month names, converting month numbers to names, and calculating the number of days based on months.

To further enhance your Excel experience and streamline your productivity, consider leveraging the capabilities of WPS Office. With its comprehensive suite of tools, including WPS Writer, Spreadsheets, and Presentation, you can seamlessly incorporate the month formula and other Excel functions into your documents, spreadsheets, and presentations. Moreover, WPS Office offers a vast collection of pre-designed templates that can expedite your work and provide professional-looking documents in no time.

Unlock the full potential of Excel and revolutionize your data analysis journey with the month formula and the power of WPS Office. Whether you're a student, professional, or business user, mastering this formula will greatly enhance your ability to extract valuable insights and effectively communicate information. Take advantage of the tools and resources at your disposal, and embark on a data-driven journey that will elevate your Excel skills to new heights.

15 years of office industry experience, tech lover and copywriter. Follow me for product reviews, comparisons, and recommendations for new apps and software.