Excel Formula Number to Month: Convert 1-12 to Name
In this article
To convert a number (1 through 12) to a month name in Excel, the most efficient method is using the TEXT function combined with the DATE function: =TEXT(DATE(2024, A1, 1), "mmmm"). This formula tells Excel to create a dummy date using your number as the month and then format that date to show only the full month name.
This process is essential for cleaning data imported from databases or accounting software where months are stored as integers. By converting these numbers to names, your reports become more readable and your data visualization (like charts and pivot tables) becomes more intuitive.
What You'll Need
- Microsoft Excel (any version from 2007 to the current Microsoft 365 version).
- A dataset containing month numbers in a single column (values must be between 1 and 12).
- A blank column adjacent to your data to house the formulas.
Step-by-Step
- Identify your data: Ensure your month numbers are in a consistent column. For this example, we will assume your month number (e.g., "5") is located in cell A2.
- Select the target cell: Click on the empty cell where you want the month name to appear (e.g., B2).
- Enter the Full Month formula: Type the following formula exactly:
=TEXT(DATE(2024, A2, 1), "mmmm")
Note: The "2024" is a placeholder year; since you only need the month, any valid year will work. - Press Enter: The cell will now display the full name of the month (e.g., "May").
- Apply to the rest of the column: Click the bottom-right corner of cell B2 (the fill handle) and drag it down to apply the formula to all other rows in your list.
- Optional: Convert to Abbreviation: If you prefer "May" as "May" (for 3-letter codes like "Jan", "Feb"), change the formula to:
=TEXT(DATE(2024, A2, 1), "mmm")
Using three "m"s instead of four triggers the abbreviated format.
Common Mistakes
- Using the MONTH function: A common error is trying to use
=MONTH(A2). The MONTH function does the opposite: it extracts a number from a date. It cannot turn a number into a name. - Incorrect Quote Marks: Ensure the "mmmm" is enclosed in double quotation marks. If you use single quotes or omit them, Excel will return a #NAME? error.
- Referencing Empty Cells: If the formula references an empty cell, Excel treats the empty cell as 0. Since there is no month 0, the DATE function may wrap around to December of the previous year, resulting in "December" appearing for blank rows.
- Hardcoding the Number: Instead of referencing a cell (like A2), some users type the number directly into the formula. While this works for one cell, it makes the sheet difficult to update. Always use cell references.
Tips
- The CHOOSE Alternative: If you want custom names (e.g., "Month 1", "Month 2") or names in a different language that your Excel version doesn't support, use the CHOOSE function:
=CHOOSE(A2, "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") - Convert Formulas to Static Text: Once you have converted your numbers to names, the cells still contain formulas. To make them permanent text, select the cells, copy them (Ctrl+C), right-click, and select Paste Values (the icon with "123").
- Dynamic Year: If your data is part of a larger date project, you can replace "2024" in the formula with a cell reference containing the actual year of your data.
Troubleshooting
If the formula does not produce the expected result, try these steps in order:
- Check for #VALUE! Errors: This usually means the cell you are referencing (A2) contains text or a symbol instead of a pure number. Ensure there are no hidden spaces or characters in your month column.
- Verify the Format: If the cell shows the formula itself instead of the month name, the cell is likely formatted as "Text". Change the cell format to "General" via the Home tab, then click into the formula bar and press Enter again.
- Check for #NUM! Errors: This happens if the number in your cell is outside the range of 1-12. Ensure your data does not contain "13" or "0".
- Regional Settings: In some non-English versions of Excel, the format code "mmmm" might differ. Check your local Excel documentation if the TEXT function returns the literal string "mmmm".
Frequently Asked Questions
Can I convert a number to a month without using a formula?
Not directly. You can use a lookup table (a separate list of 1-12 and their names) and use a VLOOKUP or XLOOKUP function to pull the name based on the number.
Does this work in Google Sheets?
Yes, the =TEXT(DATE(2024, A2, 1), "mmmm") formula works identically in Google Sheets.
How do I get the month name in a different language?
The TEXT function typically uses the language settings of your operating system. To force a specific language, you would need to use the CHOOSE function and manually type the month names in the desired language.
What happens if my month number is a decimal?
The DATE function will truncate the decimal. For example, 1.5 will be treated as 1 (January). If you need specific rounding, use the ROUND function inside the DATE formula.
Can I use this to create a full date?
Yes. If you have a year in cell B2 and a day in cell C2, you can combine them: =DATE(B2, A2, C2). This creates a real Excel date that you can then format however you like using the Format Cells menu.