Excel Year Function

“excel year function” comes up constantly, so this page leads with the exact answer, and only then explains the detail. Everything works in Excel on Windows and Mac and maps almost one-to-one to Google Sheets. Copy the answer above and get back to work, or read on to turn a one-off fix into something you never have to look up again.

Exact answer

In Excel: use =MONTH(A2), =YEAR(A2) and =DAY(A2) to pull the three parts out of a date — each returns a NUMBER, so January is 1, not "Jan".

Syntax

=MONTH(serial_number), =YEAR(serial_number), =DAY(serial_number)

Arguments

ArgumentDescription
serial_numberrequiredThe date to read the part from — a cell holding a real date, not text that looks like one.

Related functions

DATEEOMONTHWEEKDAYDATEDIF
Annotated stepsExcel
1

Confirm the column really holds dates — right-aligned by default, and =ISNUMBER(A2) returns TRUE.

2

Use =MONTH(A2), =YEAR(A2) or =DAY(A2) for the numeric part.

3

For a name rather than a number, use =TEXT(A2,"mmmm") or "mmm"; remember the result is text.

4

For a sortable month-and-year key, use =TEXT(A2,"yyyy-mm") rather than joining two numbers.

5

For grouping in a PivotTable or on a chart axis, =EOMONTH(A2,-1)+1 gives a real date at the month start.

6

If you get #VALUE!, the cell is text: fix it with DATEVALUE or Data ▸ Text to Columns before extracting anything.

Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

Need it as an auditable file?

Ships inside the linked template — formula-driven, unlocked, audit-ready.

View template

What this does

These three read one component out of a date serial number. MONTH returns 1–12, DAY returns 1–31, YEAR returns the four-digit year. The single most common surprise is that MONTH returns a number: to get a month NAME you need =TEXT(A2, "mmmm") for January or "mmm" for Jan, and TEXT returns text, so the result sorts alphabetically rather than chronologically. That is why a report grouped by month name usually runs April, August, December unless the sort is done on the month number and only the display uses TEXT. The second thing worth knowing is that a "month and year" grouping key should not be built by concatenating MONTH and YEAR — =TEXT(A2,"yyyy-mm") gives a key that sorts correctly, and =EOMONTH(A2,0) gives a real date you can chart on a time axis. Finally, these functions need a genuine date: fed text like "03/04/2026" they return #VALUE!, which is the fastest way to discover an imported column never became dates at all. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. For “excel year function”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected formula change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a calculation you can defend to a CFO or an auditor useful in real work: repeatable, auditable, and not dependent on memory or luck.

A worked example

A2 holds 2026-08-14. =MONTH(A2) → 8, =YEAR(A2) → 2026, =DAY(A2) → 14. For a label rather than a number, =TEXT(A2,"mmmm") → August. For a grouping key that sorts properly, =TEXT(A2,"yyyy-mm") → 2026-08. To collapse a whole column to month starts for a PivotTable or chart, =EOMONTH(A2,-1)+1 → 2026-08-01. Almost every monthly report starts by splitting a date column into parts, and the two traps — numbers rather than names, and text keys that sort alphabetically — account for most of the wrong-looking summaries that follow. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.

In Google Sheets

Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. Keep this page bookmarked for the next time the same question comes up. Better still, rebuild the example once in your own sheet — doing it yourself, with the tool above to check against, is what turns a copied formula into a technique you own. If you take one thing from this page on “excel year function”, make it the habit rather than the keystrokes: set the problem up with labelled inputs, reference those cells, and let Excel do the recomputing. Bookmark the page for the syntax, but do the example once in a blank sheet and check it against the tool above — five minutes of hands-on practice fixes the method in memory far better than re-reading, and it surfaces the small snags while they are still harmless. After that the technique is genuinely yours: faster than searching for it again, and reliable enough to drop into work that other people depend on.

Common mistakes

  • Expecting MONTH to return "August" — it returns 8, and the name needs TEXT.
  • Sorting or grouping on a TEXT month name, which orders April, August, December instead of chronologically.
  • Building a month-year key as MONTH&YEAR, which makes 12026 for December and sorts nonsensically.
  • Running these against text that merely looks like a date and reading #VALUE! as a formula problem rather than a data problem.
  • Using =YEAR(TODAY())-YEAR(B2) as an age, which is wrong by up to a year — DATEDIF with "y" is the correct tool.

Frequently asked questions

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

=MONTH(A2) returns the month number, 1 to 12. For the name, use =TEXT(A2,"mmmm") or "mmm".

How do I extract the year from a date?

=YEAR(A2) returns the four-digit year as a number.

How do I get month and year together?

=TEXT(A2,"yyyy-mm") gives a key that sorts correctly, and =EOMONTH(A2,-1)+1 gives a real date at the start of the month for charts and PivotTables.

How do I turn a month number into a month name?

=TEXT(DATE(2026, A2, 1), "mmmm") — build any date in that month and format it. The result is text.

Why does MONTH return #VALUE!?

The cell holds text rather than a date. Check with =ISNUMBER(A2) and convert with DATEVALUE or Data ▸ Text to Columns.

Other ways people ask this

This guide also answers

  • year formula excel