On this page ⌄
- Get the month name with TEXT
- Get the month number with MONTH
- Show the month name but keep the date
- TEXT vs a custom number format: which to use
- Your own month labels with CHOOSE
- Month name from a month number
- Month and year together
- Quarter labels from a date
- Count and sum by month
- Fix wrong months: dates stored as text
- Blank cells show January
- Month names in other languages
- Common mistakes when getting the month from a date
- Frequently asked questions about month names in Excel
- Which versions of Excel have TEXT, MONTH and CHOOSE?
- Key takeaways
To get the month name from a date in Excel, use TEXT with a month format code. "mmmm" returns the full name, and "mmm" the three-letter short name:
=TEXT(B2, "mmmm")→ January=TEXT(B2, "mmm")→ JanFor the month as a number from 1 to 12, use MONTH instead. And if you only want a column of dates to show the month, a custom number format does it without changing the dates. This guide covers all three, plus CHOOSE for your own labels, month names from month numbers, month and year together, quarters and totals by month. It also covers the usual problems: dates stored as text, blank cells that show January and format codes that change with the language of Excel.
The examples use this shipping log in A1:D8, the same one as the days between dates guide:
| A: Order ID | B: Order date | C: Ship date | D: Amount | |
|---|---|---|---|---|
| 2 | SO-1001 | Jan 5, 2026 | Jan 8, 2026 | $420.00 |
| 3 | SO-1002 | Jan 12, 2026 | Jan 20, 2026 | $1,180.00 |
| 4 | SO-1003 | Jan 27, 2026 | Feb 2, 2026 | $760.00 |
| 5 | SO-1004 | Feb 9, 2026 | Feb 10, 2026 | $2,350.00 |
| 6 | SO-1005 | Feb 16, 2026 | Feb 26, 2026 | $515.00 |
| 7 | SO-1006 | Mar 2, 2026 | Mar 5, 2026 | $1,990.00 |
| 8 | SO-1007 | Mar 23, 2026 | Apr 1, 2026 | $880.00 |
Columns B and C hold real Excel dates, not text that looks like a date.
Get the month name with TEXT
TEXT turns a number into text in the format you choose. To Excel, a date is a number, so TEXT can show it as just its month:
=TEXT(value, format_text)| Argument | What it means | Example |
|---|---|---|
| value | The date, or a cell that holds one | B7 |
| format_text | A format code, in double quotes | "mmmm" |
In which month was SO-1006 ordered, and in which month did SO-1007 ship?
=TEXT(B7, "mmmm")→ March=TEXT(C8, "mmmm")→ AprilTo add the month to every row, type =TEXT(B2, "mmmm") in E2 and copy it down to E8. In Microsoft 365 and Excel 2021 or later, one formula does the whole column: =TEXT(B2:B8, "mmm") spills seven short month names into the cells below, one for each order.
The format code decides what you get. Here are the month codes, used on March 2 in B7:
| Format code | What it returns | =TEXT(B7, code) |
|---|---|---|
"m" | The month number, without a leading zero | 3 |
"mm" | The month number, as two digits | 03 |
"mmm" | The short name | Mar |
"mmmm" | The full name | March |
"mmmmm" | The first letter of the name | M |
Days work the same way: "ddd" gives the short day name, and "dddd" the full one. SO-1003 was ordered on January 27, 2026, and you can mix the codes with spaces and commas:
=TEXT(B4, "dddd")→ Tuesday=TEXT(B4, "dddd, mmmm d")→ Tuesday, January 27One more catch, for formats that include a time: m and mm mean minutes when they come right after h or hh, or right before ss. So "h:mm" shows the minutes, not the month.
Get the month number with MONTH
MONTH returns the month of a date as a number from 1, for January, to 12, for December. It has one argument, the date:
=MONTH(B2)→ 1=MONTH(B7)→ 3=MONTH(C8)→ 4Use MONTH whenever you need to calculate with the month or compare it to something: a quarter, a test inside SUMPRODUCT or FILTER, or the position in a CHOOSE list. Its result is a real number. =TEXT(B7, "m") looks the same, but it's the text 3, and text never equals a number:
=MONTH(B7)=3→ TRUE=TEXT(B7, "m")=3→ FALSEYEAR and DAY pull out the other two parts of a date the same way: =YEAR(B7) returns 2026, and =DAY(B7) returns 2.
Your turn. The sheet below is live and uses the same shipping log. The exercise asks for the month number of a different order, SO-1004. It wants a number, not a name, so use MONTH rather than TEXT. Find the order's row, point MONTH at its order date and press Enter.
Try it yourself
A live spreadsheet. Type a formula and press Enter to check it.
Which month number was order SO-1004 placed in?
Write your formula in the green cell, G2.
Click a cell to add it to your formula, drag to select a range, or click a column letter for the whole column.
Show the month name but keep the date
TEXT puts the month name in a new cell. If you'd rather have the date column itself show the month, change its number format instead. The value in the cell stays a date, and only what you see changes:
- Select the dates, such as B2:B8.
- Press Ctrl+1, or Cmd+1 on a Mac, to open Format Cells.
- On the Number tab, choose Custom.
- In the Type box, type
mmmm, ormmmfor short names, and click OK.
B2 now shows January, and B8 shows March. Select B8, though, and the formula bar still shows 3/23/2026. The date is still there, so subtracting dates, DAYS, NETWORKDAYS and every other date formula keep working.
A custom format takes the same codes as TEXT, and you can mix in other parts of the date. mmmm d shows B8 as March 23, ddd, mmm d shows Mon, Mar 23, and mmm yyyy shows Mar 2026. Microsoft's Format a date the way you want page lists the other codes.
TEXT vs a custom number format: which to use
Both show January, but the cells hold different things, and that changes how they behave:
Custom number format mmmm | =TEXT(B2, "mmmm") | |
|---|---|---|
| What the cell holds | The date, 46027 | The text January |
| Sorting | By date, oldest to newest | Alphabetically |
| Date math and date functions | Work | Don't, because there's no date left |
| Joined with & | Gives the serial number, 46027 | Gives January |
| Opened in Excel in another language | The format is translated for you | The format code stays as typed |
Sorting shows the difference best. Say column E holds =TEXT(C2, "mmmm") for each ship date. Sort the table by column E from A to Z, and April comes first, followed by February, January and March, because text sorts letter by letter. Format the ship dates in column C as mmmm instead and sort them Oldest to Newest, and the months stay in calendar order, from January to April.
So keep the dates and change the format when the column is still a list of dates you want to sort, filter or calculate with. Use TEXT when you need the month as text: in a sentence or label built with &, or in a helper column that a condition matches against.
Your own month labels with CHOOSE
TEXT can only return the names Excel knows. For any other labels, use CHOOSE with MONTH. CHOOSE takes a position number and a list, and returns the item at that position:
=CHOOSE(index_num, value1, [value2], ...)MONTH gives the position, so list twelve labels, starting with January's:
=CHOOSE(MONTH(B7), "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")→ MarThat's the same as =TEXT(B7, "mmm"), except that you choose the labels. Write Sept instead of Sep, add periods to the short names, or use a language other than your Excel's. Here are the Spanish names, which come out the same on every computer:
=CHOOSE(MONTH(C8), "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre")→ abrilList all twelve labels. CHOOSE returns #VALUE! when the position is higher than the number of items, so a list that stops at "Nov" breaks every December date.
Month name from a month number
Sometimes you have a month number rather than a date, from MONTH, a drop-down list or an imported file. Point TEXT at it, and every number from 1 to 12 returns January:
=TEXT(3, "mmmm")→ JanuaryTEXT reads 3 as a date serial number, and serial number 3 is January 3, 1900, day 3 of Excel's calendar. Every number up to 31 is a day in January 1900. The days between dates guide explains how serial numbers work.
The fix is to build a real date in that month with DATE(year, month, day). With 3 in H2:
=TEXT(DATE(2026, H2, 1), "mmmm")→ MarchEvery month has a day 1, so any year works. CHOOSE works too, without a date: =CHOOSE(H2, "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") also returns March.
You may also come across =TEXT(H2*29, "mmmm"). Multiplying by 29 happens to land in the right month of 1900 for every number from 1 to 12, so it works, but it's hard to read. DATE says what it does.
In Microsoft 365 and Excel 2021 or later, the same idea lists all twelve months at once:
=TEXT(DATE(2026, SEQUENCE(12), 1), "mmmm")SEQUENCE(12) gives the numbers 1 to 12, so the formula spills the names from January to December into twelve cells. In any version, you can type January in a cell and drag the fill handle down to fill in the rest.
Month and year together
Add a year code to the same format. "yyyy" is the four-digit year, and "yy" the last two digits:
=TEXT(B8, "mmmm yyyy")→ March 2026=TEXT(B8, "mmm yyyy")→ Mar 2026=TEXT(B8, "mmm-yy")→ Mar-26The year matters as soon as your data covers more than one year, because March on its own doesn't say which March. This is also how you put a month into a sentence. & joins the serial number behind a date, not what the cell shows, so wrap the date in TEXT first:
="Ordered in "&B8→ Ordered in 46104="Ordered in "&TEXT(B8, "mmmm yyyy")→ Ordered in March 2026The concatenate guide has more format codes for joined text.
For a label that sorts correctly as text, put the year first and use a two-digit month:
=TEXT(B8, "yyyy-mm")→ 2026-03Labels like 2025-12, 2026-01 and 2026-02 sort in calendar order, even across years, because the year comes first and every month has two digits. To list each month once, wrap the formula in UNIQUE. In Microsoft 365 and Excel 2021 or later, =UNIQUE(TEXT(C2:C8, "mmm yyyy")) spills the four months the orders shipped in: Jan 2026, Feb 2026, Mar 2026 and Apr 2026.
To group by month and keep a real date instead of text, turn each date into the first day of its month:
=DATE(YEAR(B8), MONTH(B8), 1)That returns March 1, 2026. Give it the custom format mmm yyyy and it shows Mar 2026, sorts by date and still works in date formulas. If you see 46082 instead, format the cell as a date.
Quarter labels from a date
There's no format code for quarters, so work the quarter out from the month. Months 1 to 3 are Q1, 4 to 6 are Q2, and so on, so divide the month by 3 and round up:
=ROUNDUP(MONTH(B8)/3, 0)→ 1="Q"&ROUNDUP(MONTH(B8)/3, 0)&" "&YEAR(B8)→ Q1 2026March is month 3, and 3 divided by 3 is 1, so SO-1007's order date falls in Q1 2026. For a fiscal year that starts in another month, CHOOSE is easier to read. If the fiscal year starts in July, July to September are Q1, and January to March are Q3:
="Q"&CHOOSE(MONTH(B8), 3, 3, 3, 4, 4, 4, 1, 1, 1, 2, 2, 2)→ Q3Count and sum by month
This is where the difference between text and dates bites. Formatting dates to show March doesn't put the word March in the cells, so a condition on the name finds nothing:
=COUNTIF(B2:B8, "March")→ 0The cells hold numbers, and no number matches the text March. There are three reliable ways to count or add up by month.
A date range with COUNTIFS or SUMIFS. Give the date column two conditions: on or after the first day of the month, and before the first day of the next one. How many orders came in during March, and what were they worth?
=COUNTIFS(B2:B8, ">="&DATE(2026, 3, 1), B2:B8, "<"&DATE(2026, 4, 1))→ 2=SUMIFS(D2:D8, B2:B8, ">="&DATE(2026, 3, 1), B2:B8, "<"&DATE(2026, 4, 1))→ $2,870That's SO-1006 and SO-1007, $1,990 plus $880. This way includes the year, works in every version and stays fast on large data. The SUMIF and SUMIFS guide and the COUNTIF guide explain the conditions, and AVERAGEIFS takes the same ones, as the AVERAGEIF guide shows.
MONTH inside SUMPRODUCT. SUMIFS can't test MONTH(B2:B8), because it only accepts ranges. SUMPRODUCT works with any calculation:
=SUMPRODUCT((MONTH(B2:B8)=3)*D2:D8)→ $2,870=SUMPRODUCT(--(MONTH(B2:B8)=3))→ 2MONTH ignores the year, so March 2026 and March 2027 would be added together. Add a (YEAR(B2:B8)=2026) test once your data covers more than one year. The SUMPRODUCT guide explains how these conditions work.
A helper column of month names. With =TEXT(B2, "mmmm") copied down column E, SUMIF can match the names:
=SUMIF(E2:E8, "March", D2:D8)→ $2,870It works, but it's the most fragile of the three. Month names have no year, "Mar" doesn't match "March", and the names change with the language of Excel. A helper column of first-of-month dates, =DATE(YEAR(B2), MONTH(B2), 1), avoids all three problems.
For a summary with one row per month, type the first day of each month in G2:G4, 1/1/2026, 2/1/2026 and 3/1/2026, and give them the custom format mmmm so they show January, February and March. Then in H2:
=SUMIFS($D$2:$D$8, $B$2:$B$8, ">="&G2, $B$2:$B$8, "<"&EDATE(G2, 1))→ $2,360EDATE(G2, 1) is the first day of the next month, so each row adds up its own month. January's three orders come to $2,360. The dollar signs keep the data ranges in place as you copy the formula down to H4, where it returns $2,870 for March.
To list the orders from one month instead of adding them up, use FILTER in Microsoft 365 or Excel 2021 or later: =FILTER(A2:A8, MONTH(B2:B8)=3) spills SO-1006 and SO-1007.
Fix wrong months: dates stored as text
Dates imported from other systems sometimes arrive as text that only looks like a date. A text date sits on the left of the cell, and ISNUMBER returns FALSE for it, where a real date gives TRUE. What happens next depends on whether Excel can read the text.
MONTH converts text in a form Excel understands as it goes. If H5 holds the text 2026-03-23:
=MONTH(H5)→ 3Text Excel can't read is the problem. Say H4 holds 23.03.2026, a day-first date from a European system, in Excel set to US dates:
=MONTH(H4)→ #VALUE!=TEXT(H4, "mmmm")→ 23.03.2026MONTH gives an error, which at least tells you something's wrong. TEXT doesn't. When its value is text that Excel can't turn into a number, TEXT returns the text unchanged, so the cell shows the date instead of a month name. If a TEXT formula hands back the date just as it was, check for a text date first.
To fix it, build a real date from the pieces with DATE, LEFT, MID and RIGHT:
=TEXT(DATE(RIGHT(H4, 4), MID(H4, 4, 2), LEFT(H4, 2)), "mmmm")→ MarchRIGHT takes the year, MID the month and LEFT the day, and DATE turns them into March 23, 2026. The LEFT, RIGHT and MID guide explains how each piece is cut. To convert a whole column in place, use Data > Text to Columns, as the days between dates guide shows. IFERROR can show a message instead of #VALUE! for the odd cell you can't fix, but fix the data where you can.
Blank cells show January
An empty cell counts as 0, and day 0 of Excel's calendar is January 0, 1900. So an empty date gives January, not an empty result. Say SO-1008 has just come in, and its order date in B9 hasn't been typed yet:
=TEXT(B9, "mmmm")→ January=MONTH(B9)→ 1This usually shows up when a formula is copied further down than the data goes, or when the dates have gaps. Test for the empty cell with IF and return empty text instead:
=IF(B9="", "", TEXT(B9, "mmmm"))The cell stays blank until the date is typed in, and then it shows the month.
Month names in other languages
TEXT's format codes follow the language settings of Excel and your computer, and so do the month names it returns. The codes in this guide are for English. In German Excel, for example, the month is still M, but the year is J, for Jahr, and the day is T, for Tag. Arguments are separated by semicolons there, too:
=TEXT(B8; "MMMM JJJJ")→ März 2026So a TEXT formula copied from an English guide, or shared with a colleague whose Excel uses another language, can return the wrong result. Custom number formats don't have this problem, because Excel translates them when the workbook is opened in another language version. If a workbook travels between languages, use a custom number format to show the month, MONTH for calculations, and CHOOSE when you need the same labels everywhere.
Common mistakes when getting the month from a date
| Problem | What's going on | Fix |
|---|---|---|
| January for every month number | TEXT reads 1 to 12 as days in January 1900 | =TEXT(DATE(2026, H2, 1), "mmmm") |
| January in empty rows | An empty cell counts as 0, which is January 0, 1900 | =IF(B9="", "", TEXT(B9, "mmmm")) |
#NAME? | The format code isn't in quotes | Write "mmmm", with the quotes |
| A number like 3 or 03 instead of a name | The format code is "m" or "mm" | Use "mmm" or "mmmm" |
| The date comes back unchanged, like 23.03.2026 | The date is text Excel can't read | DATE with LEFT, MID and RIGHT, or Text to Columns |
#VALUE! from MONTH | The same: a text date | The same fixes |
| Months sort April, February, January, March | TEXT returns text, which sorts alphabetically | Keep the dates and use a custom number format, or sort by the date column |
=COUNTIF(B2:B8, "March") returns 0 | The cells hold dates, whatever they show | COUNTIFS with a date range, or SUMPRODUCT with MONTH |
| Totals mix up years | MONTH and month names ignore the year | Use date ranges, or add a YEAR test |
| 46104 instead of a month in joined text | & joins the serial number behind the date | TEXT(B8, "mmmm yyyy") |
| Wrong results in another language version | TEXT's format codes depend on the language | Use the local codes, a custom number format or CHOOSE |
#VALUE! from CHOOSE | The list has fewer than 12 labels | List all twelve |
Frequently asked questions about month names in Excel
How do I get the current month name?
Use TODAY as the date. On November 23, 2026, the day this guide was published:
=TEXT(TODAY(), "mmmm")→ November=TEXT(EDATE(TODAY(), -1), "mmmm")→ OctoberEDATE moves a date by whole months, so the second formula gives last month's name. That's safer than MONTH(TODAY())-1, which gives 0 in January, not 12. Your results will be different, because TODAY moves on every day.
How do I convert a month name to a number?
With the text March in H3, either of these returns 3:
=MONTH(DATEVALUE(H3&" 1"))→ 3=MATCH(H3, {"January","February","March","April","May","June","July","August","September","October","November","December"}, 0)→ 3The first joins March and 1 into March 1, a date Excel can read, and takes its month. It works with short names like Mar too. MATCH doesn't depend on Excel reading dates at all: it finds the name's position in the list, ignoring upper and lower case.
How do I sort by month and ignore the year?
Add a helper column with =MONTH(B2), copy it down and sort by it, smallest to largest. That's how you'd sort a list of birthdays from January to December, whatever the year. If you already have a column of month names from TEXT, sort it with Data > Sort, and under Order choose Custom List, then pick the list that starts January, February, March.
How do I get the first or last day of a month?
=DATE(YEAR(B8), MONTH(B8), 1) returns March 1, 2026, the first day of the month SO-1007 was ordered in, and =EOMONTH(B8, 0) returns March 31, 2026, the last day. If you see a number like 46112 instead, format the cell as a date.
Which versions of Excel have TEXT, MONTH and CHOOSE?
TEXT, MONTH, CHOOSE, DATE and YEAR work in every version of Excel, including Microsoft 365, on Windows and Mac, and in Excel for the web. Custom number formats like mmmm work in every version of Excel for Windows and Mac. EDATE and EOMONTH are built in from Excel 2007 onward. UNIQUE, FILTER and SEQUENCE need Microsoft 365 or Excel 2021 or later, and so does giving TEXT a whole range so it spills. Google Sheets has TEXT, MONTH and CHOOSE with the same arguments, and the "mmmm" and "mmm" codes work the same way there. Its custom date formats are under Format > Number > Custom date and time.
For Microsoft's own examples, see the TEXT function, MONTH function and CHOOSE function pages, and Format a date the way you want for every date format code.
For more practice, the dates topic has the free order-month and days-to-ship exercises on the same shipping log, plus Premium exercises on the day of the week, the quarter an order shipped in, the total for one month and an invoice due date.
Key takeaways
=TEXT(date, "mmmm")returns the full month name and "mmm" the short one. Add the year with "yyyy", as inTEXT(B8, "mmm yyyy"), and wrap dates in TEXT before joining them with &.=MONTH(date)returns the month as a number from 1 to 12. Use it for calculations, conditions and the position in a CHOOSE list of your own labels.- TEXT returns text, which sorts alphabetically. To show the month and keep a real date, use the custom number format mmmm instead. For a month number, use
TEXT(DATE(2026, H2, 1), "mmmm"), because TEXT reads 1 to 12 as days in January 1900. - Empty cells give January, and text dates come back unchanged or as #VALUE!. To count or add up by month, use date ranges in COUNTIFS and SUMIFS, or MONTH inside SUMPRODUCT, not month names.
Practice
Keep going with TEXT and MONTH exercises
Reading gets you started. Solving a few of these is what makes it stick.
- 1Which month?FreeWhich month number was order SO-1004 placed in?→
- 2Day of the week PremiumOn what day of the week was order SO-1004 placed? Return the day's name, like Friday.→
- 3Which quarter? PremiumWhich quarter did order SO-1007 ship in? Return it like "Q1".→
- 4Total for one month PremiumWhat was the total amount ordered in February 2026?→
- 5Invoice due date PremiumInvoices are due on the last day of the month after the order. When is SO-1001 due?→

About the author
Brian Millot
Brian Millot is an indie hacker based in France who builds small, focused web products. He built and runs Excel Formula Practice, from the in-browser spreadsheet that checks your formulas to the exercise library, and he writes the formula guides.