Excel Get Month from Date: 5 Easy Ways
In this article
To get the month from a date in Excel, use the MONTH function, which returns the month as a number (1–12), or combine TEXT, CHOOSE, or SWITCH to get the month name. This article shows you the exact formulas, how to handle text dates, and how to avoid common errors.
in d | Date | - | 2024-06-15 | 0 out m_num | Month number | - | MONTH(d) | 0 out m_name | Month name | - | TEXT(d,"mmmm") | 0 out m_short | Short month | - | TEXT(d,"mmm") | 0
Formula
The core formula is simple: =MONTH(serial_number) where serial_number is a valid Excel date. The result is an integer from 1 (January) to 12 (December). For the month name, use =TEXT(date,"mmmm") for the full name (e.g., “June”) or =TEXT(date,"mmm") for the abbreviated name (e.g., “Jun”).
If your date is stored as text (e.g., “2024-06-15”), you may need to convert it first with =DATEVALUE(date_text) or use =MONTH(DATEVALUE(A1)).
Worked Example
Using the default date from the calculator above, June 15, 2024:
- Enter the date in cell A1:
2024-06-15(Excel stores it as a serial number). - In cell B1, enter
=MONTH(A1)→ returns 6. - In cell C1, enter
=TEXT(A1,"mmmm")→ returns June. - In cell D1, enter
=TEXT(A1,"mmm")→ returns Jun.
The calculator above replicates these results, showing month number 6, full name “June”, and short name “Jun”.
Why Use MONTH vs. TEXT?
The MONTH function returns a numeric value, which is ideal for sorting, filtering, or using in calculations (e.g., comparing months, creating pivot tables). Use TEXT when you need a display label, such as in charts or reports, because it returns a text string that cannot be used in arithmetic.
For example, if you want to count how many sales occurred in June, you’d use =COUNTIF(B:B,6) where column B contains MONTH results. If you used TEXT, you’d need to match the exact text “June”.
How to Get Month from Text Dates
Sometimes dates are imported as text (e.g., “15/06/2024” or “June 15, 2024”). Excel may not recognize them as dates, so MONTH will return a #VALUE! error. To fix:
- Use
=DATEVALUE(A1)to convert text to a date serial number, then wrap with MONTH:=MONTH(DATEVALUE(A1)). - If the text is in a non-standard format (e.g., “15-Jun-2024”), use
=MONTH(DATEVALUE(A1))as well, but you may need to specify the date system in regional settings. - Alternatively, use
=MONTH(--A1)which forces Excel to coerce text to a number if the text is a valid date.
If the text includes extra characters, clean it first with =TRIM(A1) or =SUBSTITUTE(A1," ","").
Common Problems and How to Fix Them
- #VALUE! error: The cell is text that Excel can’t recognize as a date. Use DATEVALUE or check the format.
- Wrong month for text like “June 15”: If you type “June 15” without a year, Excel treats it as a current-year date, but MONTH may still work. However, if it’s stored as text, convert it.
- Month shows as a number but you want the name: Use TEXT or CHOOSE:
=CHOOSE(MONTH(A1),"Jan","Feb",...). - Date is stored as a serial number: If you see a number like 45458, format the cell as a date first, then apply MONTH.
- Regional date formats: In some locales, dates are day/month/year. Excel handles this automatically if the cell is formatted as a date, but text dates may need explicit parsing.
Alternatives: CHOOSE, SWITCH, and Custom Formats
Besides MONTH and TEXT, you can use:
=CHOOSE(MONTH(A1),"January","February","March","April","May","June","July","August","September","October","November","December")– gives you full control over the output text.=SWITCH(MONTH(A1),1,"Jan",2,"Feb",...,12,"Dec")– similar to CHOOSE but may be shorter in some Excel versions.- Custom number format: Right-click cell → Format Cells → Custom → type
mmmormmmm. This changes the display only, not the underlying value, so MONTH still works.
Using Month in Pivot Tables and Charts
When you group dates in a pivot table, Excel automatically offers to group by months. If you have a column of dates, you can also create a helper column with =MONTH(A2) and use that as a row label. For charts, using the month name (via TEXT) makes the axis labels readable, while using the month number keeps the axis numeric for better scaling.
Frequently Asked Questions
How do I get the month name from a date in Excel?
Use =TEXT(A1,"mmmm") for the full month name (e.g., “June”) or =TEXT(A1,"mmm") for the abbreviated name (e.g., “Jun”). If you want the month as a number, use =MONTH(A1).
Why does MONTH return #VALUE!?
This usually means the cell contains text that Excel doesn’t recognize as a date. Convert it using =DATEVALUE(A1) or ensure the cell is formatted as a date. Also check for hidden spaces or non-breaking characters.
Can I get the month from a date without a formula?
Yes, you can use the “Text to Columns” wizard (Data tab → Text to Columns → Delimited → choose a delimiter that separates the month, or use Fixed width) to extract the month part. However, this changes your data, so it’s often safer to use a formula.
How do I get the month as a number from a text date like “2024-06-15”?
Use =MONTH(DATEVALUE("2024-06-15")) or simply =MONTH(--"2024-06-15") if your Excel recognizes the text as a date. If not, you can parse it manually: =MID(A1,6,2) would give “06” but as text; convert to number with --MID(A1,6,2).
What’s the difference between MONTH and TEXT?
MONTH returns a number (1-12) that you can use in calculations, sorting, and comparisons. TEXT returns a string (like “June”) that is for display only and cannot be used in arithmetic. Choose based on your need: numeric for analysis, text for presentation.
How do I get the month from a date in Google Sheets?
The same functions work: =MONTH(A1) and =TEXT(A1,"mmmm"). Google Sheets also supports =MONTH(DATEVALUE(A1)) for text dates.