Split First and Last Name in Excel — With Examples (TEXTSPLIT, LEFT, FIND)
Learn how to split first and last name in Excel: TEXTSPLIT, LEFT and FIND formulas, middle names, Flash Fill and Text to...
Read Guide →You have a column of order dates and you need a column that says “Sep 2026” — or the month number, or the quarter. The answer depends on what you want the result for: for a label, use =TEXT(D2,"mmm yyyy"), which turns 3 Sep 2026 into “Sep 2026”; for grouping, sorting and totalling, use =EOMONTH(D2,-1)+1, which returns 1 Sep 2026 as a real date; and for the two parts as numbers, use =MONTH(D2) and =YEAR(D2). This guide runs all of them on the same ten-order table, so you can check every answer yourself — the name, the number, the label, the grouping date, the first and last day, the days in the month, the quarter, the 4th Wednesday and the week number — plus the trap that mixes two years together.
Quick takeaway: TEXT gives you the name; MONTH and YEAR give you the numbers.
=TEXT(D2,"mmm yyyy") → “Sep 2026”. A label — text, not a date.=MONTH(D2) → 9, =YEAR(D2) → 2026. Numbers you can filter and calculate with.=EOMONTH(D2,-1)+1 → 1 Sep 2026. A real date — the one to group, sort and total by.=YEAR(D2)*100+MONTH(D2) → 202609. One sortable number for month and year together.
Every example below uses the same ten orders. Every result was checked against them.
| Excel row | A Rep | B Region | C Sales | D Order Date |
|---|---|---|---|---|
| 2 | Alex | East | 1200 | 9/3/2026 |
| 3 | Priya | West | 850 | 9/15/2026 |
| 4 | Jordan | east | 2400 | 10/2/2026 |
| 5 | Sam | North | 450 | 10/9/2026 |
| 6 | Alex | West | 1750 | 10/20/2026 |
| 7 | Taylor | East | 600 | 10/22/2026 |
| 8 | Priya | East | 900 | 11/4/2026 |
| 9 | Jordan | South | 1100 | 11/12/2026 |
| 10 | Sam | West | 300 | 11/20/2026 |
| 11 | Alex | North | 1500 | 12/1/2026 |
The most direct way to separate a date is by using three dedicated, easy-to-remember functions. DAY returns the day of the month as a number from 1 to 31, MONTH returns the month as a number from 1 (January) to 12 (December), and YEAR extracts the four-digit year.
| Excel row | D Order Date | =DAY(D2) | =MONTH(D2) | =YEAR(D2) |
|---|---|---|---|---|
| 2 | 9/3/2026 | 3 | 9 | 2026 |
| 3 | 9/15/2026 | 15 | 9 | 2026 |
| 4 | 10/2/2026 | 2 | 10 | 2026 |
| 5 | 10/9/2026 | 9 | 10 | 2026 |
| 6 | 10/20/2026 | 20 | 10 | 2026 |
| 7 | 10/22/2026 | 22 | 10 | 2026 |
| 8 | 11/4/2026 | 4 | 11 | 2026 |
| 9 | 11/12/2026 | 12 | 11 | 2026 |
| 10 | 11/20/2026 | 20 | 11 | 2026 |
| 11 | 12/1/2026 | 1 | 12 | 2026 |
For filters, comparisons and maths you want numbers, not text. =MONTH(D2) returns 9 and =YEAR(D2) returns 2026, and the time of day is ignored if the cell holds one. Both need a real date in the cell: if the date was imported as text, MONTH and YEAR still work when Excel can read the text as a date in your regional settings, and return #VALUE! when it cannot.
Maybe you prefer to see the name of the month or an abbreviation rather than the number. You can do this for the month using the TEXT function. The syntax is TEXT(value, format_code), where the value is the cell containing the date and the format_code is how you want to display the result.
| Format code | What it gives | =TEXT(D2,”…”) on 9/3/2026 |
|---|---|---|
m | Month, one or two digits | 9 |
mm | Month, two digits | 09 |
mmm | Month, three letters | Sep |
mmmm | Month, full name | September |
yy | Year, two digits | 26 |
yyyy | Year, four digits | 2026 |
You need at least four M’s within quotation marks to get the full month name. The number of letters in the month’s name does not correspond to the number of M’s in the argument; just enter at least four of them. To get the three-letter abbreviation instead of the full name, just use three M’s.
| Excel row | D Order Date | =TEXT(D2,”mmmm”) | =TEXT(D2,”mmm”) | =TEXT(D2,”mmm yyyy”) | =TEXT(D2,”m/yy”) |
|---|---|---|---|---|---|
| 2 | 9/3/2026 | September | Sep | Sep 2026 | 9/26 |
| 3 | 9/15/2026 | September | Sep | Sep 2026 | 9/26 |
| 4 | 10/2/2026 | October | Oct | Oct 2026 | 10/26 |
| 5 | 10/9/2026 | October | Oct | Oct 2026 | 10/26 |
| 6 | 10/20/2026 | October | Oct | Oct 2026 | 10/26 |
| 7 | 10/22/2026 | October | Oct | Oct 2026 | 10/26 |
| 8 | 11/4/2026 | November | Nov | Nov 2026 | 11/26 |
| 9 | 11/12/2026 | November | Nov | Nov 2026 | 11/26 |
| 10 | 11/20/2026 | November | Nov | Nov 2026 | 11/26 |
| 11 | 12/1/2026 | December | Dec | Dec 2026 | 12/26 |
Two things to know. The result is text, so it lines up on the left and cannot be used in date maths — =TEXT(D2,"mmm yyyy")+1 errors, and a SUMIFS on the text column finds nothing. And TEXT format codes follow the language of your Excel: in a German version the year code is JJJJ, not yyyy, so a shared formula can show the wrong thing on another person’s computer. The same TEXT function is covered in full, with the currency and percentage codes, on the TEXT function page.
There are three ways to put the month and year together, and they are not interchangeable:
| What you want | Formula | Result on 9/3/2026 | What it is |
|---|---|---|---|
| A label to read | =TEXT(D2,"mmm yyyy") | Sep 2026 | Text — good for a heading, useless for maths |
| One sortable number | =YEAR(D2)*100+MONTH(D2) | 202609 | A number — sorts and compares correctly |
| A real date to group by | =EOMONTH(D2,-1)+1 | 1 Sep 2026 | A date — sorts in date order, works in SUMIFS and PivotTables |
The number version is the one to use in a lookup table: 202609 for September, 202610 for October, 202611 for November, 202612 for December — the year times 100 plus the month, so the months sort in order and two years never collide. The date version is the one to use in a PivotTable: format the cell as mmm yyyy and it shows “Sep 2026” while staying a real date underneath. You can also combine the two numbers with an ampersand, =MONTH(D2)&"/"&YEAR(D2), which gives “9/2026” — but that is text again, so it does not sort as a date.
MONTH alone is a trap once your data spans more than a year. =SUMPRODUCT((MONTH(D2:D11)=9)*C2:C11) returns 2050 on this table — September’s 1200 + 850 — and that is right here, because every order is from 2026. But add one September 2025 order of 400 and the same formula returns 2450, because it adds September 2025 to September 2026 without telling you. The fix is to carry the year with the month:
=SUMPRODUCT((YEAR(D2:D11)=2026)*(MONTH(D2:D11)=9)*C2:C11)
That returns 2050 — September 2026 only. Or group by the month-year number instead: =SUMPRODUCT((YEAR(D2:D11)*100+MONTH(D2:D11)=202609)*C2:C11) also returns 2050. The monthly totals on this table, by the grouping date, are September 2050, October 5200, November 2300 and December 1500 — and the total is 11050, which matches the sum of all ten orders.
If you need to calculate the first or last day of a month, the EOMONTH (end of month) function works well:
| Excel row | D Order Date | First day =EOMONTH(D2,-1)+1 | Last day =EOMONTH(D2,0) | Days in month =DAY(EOMONTH(D2,0)) |
|---|---|---|---|---|
| 2 | 9/3/2026 | 9/1/2026 | 9/30/2026 | 30 |
| 3 | 9/15/2026 | 9/1/2026 | 9/30/2026 | 30 |
| 4 | 10/2/2026 | 10/1/2026 | 10/31/2026 | 31 |
| 5 | 10/9/2026 | 10/1/2026 | 10/31/2026 | 31 |
| 6 | 10/20/2026 | 10/1/2026 | 10/31/2026 | 31 |
| 7 | 10/22/2026 | 10/1/2026 | 10/31/2026 | 31 |
| 8 | 11/4/2026 | 11/1/2026 | 11/30/2026 | 30 |
| 9 | 11/12/2026 | 11/1/2026 | 11/30/2026 | 30 |
| 10 | 11/20/2026 | 11/1/2026 | 11/30/2026 | 30 |
| 11 | 12/1/2026 | 12/1/2026 | 12/31/2026 | 31 |
The last day of the previous month is =EOMONTH(D2,-1), the first day of the selected month is =EOMONTH(D2,-1)+1, and the last day of the selected month, last year, is =EOMONTH(D2,-12). Once you have two such dates, the days between dates guide counts the gap between them. The days-in-month formula is the last day’s day number: September has 30, October 31, November 30, December 31. February is the one to watch — 2026 is not a leap year, so February 2026 has 28 days, and February 2024 had 29.
The quarter is the month number, divided into threes:
| Excel row | D Order Date | Quarter =INT((MONTH(D2)-1)/3)+1 | Label =”Q”&INT((MONTH(D2)-1)/3)+1&” “&YEAR(D2) | Quarter end |
|---|---|---|---|---|
| 2 | 9/3/2026 | 3 | Q3 2026 | 9/30/2026 |
| 3 | 9/15/2026 | 3 | Q3 2026 | 9/30/2026 |
| 4 | 10/2/2026 | 4 | Q4 2026 | 12/31/2026 |
| 5 | 10/9/2026 | 4 | Q4 2026 | 12/31/2026 |
| 6 | 10/20/2026 | 4 | Q4 2026 | 12/31/2026 |
| 7 | 10/22/2026 | 4 | Q4 2026 | 12/31/2026 |
| 8 | 11/4/2026 | 4 | Q4 2026 | 12/31/2026 |
| 9 | 11/12/2026 | 4 | Q4 2026 | 12/31/2026 |
| 10 | 11/20/2026 | 4 | Q4 2026 | 12/31/2026 |
| 11 | 12/1/2026 | 4 | Q4 2026 | 12/31/2026 |
The quarter number is =INT((MONTH(D2)-1)/3)+1 — months 1–3 give 1, 4–6 give 2, 7–9 give 3, 10–12 give 4. The quarter end is the last day of the quarter’s third month: =EOMONTH(DATE(YEAR(D2),INT((MONTH(D2)-1)/3)*3+3,1),0) — 30 September for Q3, 31 December for Q4. The quarter totals on this table are Q3 2050 and Q4 9000, which add to 11050.
The “4th Wednesday” keyword is a date built from the month, not a lookup:
=DATE(YEAR(D2),MONTH(D2),1)+CHOOSE(WEEKDAY(DATE(YEAR(D2),MONTH(D2),1)),3,2,1,0,6,5,4)+21
That returns the 4th Wednesday of the order’s month:
| Month | 4th Wednesday |
|---|---|
| September 2026 | 23 Sep 2026 |
| October 2026 | 28 Oct 2026 |
| November 2026 | 25 Nov 2026 |
| December 2026 | 23 Dec 2026 |
Read it from the inside out: DATE(YEAR(D2),MONTH(D2),1) is the 1st of the month; WEEKDAY of the 1st tells you which day of the week it is; the CHOOSE gives the days to the first Wednesday — 3 if the 1st is a Sunday, 2 if Monday, 1 if Tuesday, 0 if Wednesday, 6 if Thursday, 5 if Friday, 4 if Saturday; and +21 moves three weeks on, from the 1st Wednesday to the 4th. September’s Wednesdays are 2, 9, 16, 23 and 30, so the 4th is the 23rd. Change the CHOOSE to target another weekday, or change +21 to +7, +14 or +28 for the 2nd, 3rd or 5th.
| Excel row | D Order Date | Weekday | =WEEKNUM(D2) | =ISOWEEKNUM(D2) |
|---|---|---|---|---|
| 2 | 9/3/2026 | Thursday | 36 | 36 |
| 3 | 9/15/2026 | Tuesday | 38 | 38 |
| 4 | 10/2/2026 | Friday | 40 | 40 |
| 5 | 10/9/2026 | Friday | 41 | 41 |
| 6 | 10/20/2026 | Tuesday | 43 | 43 |
| 7 | 10/22/2026 | Thursday | 43 | 43 |
| 8 | 11/4/2026 | Wednesday | 45 | 45 |
| 9 | 11/12/2026 | Thursday | 46 | 46 |
| 10 | 11/20/2026 | Friday | 47 | 47 |
| 11 | 12/1/2026 | Tuesday | 49 | 49 |
WEEKNUM and ISOWEEKNUM agree on all ten dates here — and they usually do in the middle of the year. They differ at the edges: 29 December 2025 is WEEKNUM 53 but ISOWEEKNUM 1, because the ISO week belongs to 2026. Use ISOWEEKNUM when the week must follow the ISO rule (weeks start Monday, week 1 is the week with the first Thursday), and WEEKNUM when the week starts on Sunday and week 1 is the week containing 1 January. The weekday itself comes from the day of week formula guide.
| Mistake | What happens | Fix |
|---|---|---|
| You used TEXT and then tried to calculate with it | TEXT gives text — =TEXT(D2,"mmm yyyy")+1 errors, and SUMIFS on the text column finds nothing | Use EOMONTH for grouping, or MONTH/YEAR for maths |
| You grouped by MONTH alone | September 2025 and September 2026 add together | Carry the year: YEAR*100+MONTH, or the EOMONTH grouping date |
| You used “mm” for the full month name | “mm” gives 09, not September | Use “mmmm” — at least four M’s |
| You used “yy” and got 26 | “yy” is the two-digit year — 26, not 2026 | Use “yyyy” for the four-digit year |
| You typed the month as text | MONTH(“September”) errors — it needs a real date | Put a real date in the cell and read MONTH from it |
| You used WEEKNUM at the year edge | 29 Dec 2025 is WEEKNUM 53 but ISOWEEKNUM 1 | Pick the week system first, then the function |
How do I get the month name from a date in Excel? =TEXT(D2,"mmmm") for the full name — September — or =TEXT(D2,"mmm") for the abbreviation — Sep.
How do I get the month and year together? For a label, =TEXT(D2,"mmm yyyy") gives “Sep 2026”. For a sortable number, =YEAR(D2)*100+MONTH(D2) gives 202609. For a real date to group by, =EOMONTH(D2,-1)+1 gives 1 Sep 2026.
How do I get the month number from a date? =MONTH(D2) — 9 for September, 10 for October, 11 for November, 12 for December. =YEAR(D2) gives 2026.
How do I get the first day of the month? =EOMONTH(D2,-1)+1 — 1 Sep 2026 for any September date. The last day is =EOMONTH(D2,0) — 30 Sep 2026.
How many days are in the month? =DAY(EOMONTH(D2,0)) — 30 for September and November, 31 for October and December.
What quarter is this date in? =INT((MONTH(D2)-1)/3)+1 — 3 for September, 4 for October, November and December. The label is ="Q"&INT((MONTH(D2)-1)/3)+1&" "&YEAR(D2).
How do I get the 4th Wednesday of the month? =DATE(YEAR(D2),MONTH(D2),1)+CHOOSE(WEEKDAY(DATE(YEAR(D2),MONTH(D2),1)),3,2,1,0,6,5,4)+21 — 23 Sep 2026 for September, 28 Oct 2026 for October.
That is the month and the year from a date in Excel: =TEXT(D2,"mmm yyyy") for the label, =MONTH(D2) and =YEAR(D2) for the numbers, and =EOMONTH(D2,-1)+1 for the real date to group by — and on the ten-order table in this guide they answer every question: September is 2050 in sales, October is 5200, November is 2300 and December is 1500; the quarters are Q3 2050 and Q4 9000; the first days are 1 Sep, 1 Oct, 1 Nov and 1 Dec; the last days are 30 Sep, 31 Oct, 30 Nov and 31 Dec; and the 4th Wednesdays are 23 Sep, 28 Oct, 25 Nov and 23 Dec. Remember the two things that catch everyone once: TEXT gives you text, so it cannot be calculated with — use the EOMONTH date for grouping and the MONTH and YEAR numbers for maths — and MONTH alone mixes years, so always carry the year with it, as 202609 or as the 1st of the month. From here, the next functions worth learning are the ones these sit next to — the TEXT function itself, for the full format codes, and the day of week formula for the weekday side of the same dates — and the full learning order for the whole site is on the Excel Formulas hub and the Date & Text topic page.
Learn how to split first and last name in Excel: TEXTSPLIT, LEFT and FIND formulas, middle names, Flash Fill and Text to...
Read Guide →Learn how to extract text after a character in Excel: TEXTAFTER and TEXTBEFORE, the last word, and the older FIND method.
Read Guide →Learn the TEXT function in Excel: format codes for currency, dates, percentages, leading zeros, and joining text with numbers.
Read Guide →