ShareYourGroupShareYourGroupExcel Formulas

Date and time functions

YEAR, MONTH and DAY functions in Excel

YEAR, MONTH and DAY return the year, the month number and the day of the month of a date.

A date carries three pieces of information. These three functions pull them apart, so that you can group sales by month, compare years, or find everyone with a birthday this month.

Syntax

=YEAR(serial_number)
=MONTH(serial_number)
=DAY(serial_number)
ArgumentWhat it is
serial_numberA date, or a cell that holds one.

Examples

Each result below is what Excel itself showed for the formula on the sample sheet.

Sample sheet: Twelve sales made by four salespeople in three regions.
ABCDEF
1DateSalespersonRegionProductUnitsAmount
205-Jan-2026AshaNorthNotebook201200
312-Jan-2026RaviSouthPen50500
420-Jan-2026MeenaNorthBag43000
502-Feb-2026AshaEastPen30300
614-Feb-2026KabirSouthNotebook15900
728-Feb-2026RaviNorthBag21500
803-Mar-2026MeenaEastNotebook402400
915-Mar-2026AshaNorthBag32250
1022-Mar-2026KabirSouthPen60600
1101-Apr-2026RaviEastNotebook251500
1218-Apr-2026MeenaNorthPen80800
1306-May-2026AshaSouthBag53750

How they work

Each takes a date and returns one number.

FunctionReturnsFor 05-Jan-2026
YEARthe four-digit year2026
MONTHthe month, 1 to 121
DAYthe day of the month, 1 to 315

The result is an ordinary number. If the cell shows a date in 1900, it has a date format left over. Change the format to General.

For the names of months and days, use TEXT with the codes "mmm", "mmmm", "ddd" or "dddd". For the day of the week as a number, use WEEKDAY.

Grouping by month

The most frequent use is a helper column. Next to each date write =MONTH(A2), then total by that column with SUMIF or a PivotTable.

A warning: the month number alone mixes years together. January 2025 and January 2026 are both 1. When the data covers more than one year, group by year and month. A combined key does it in one column:

Without a helper column, SUMPRODUCT can test the month inside the formula, as the fifth example shows. SUMIFS cannot, because it does not accept a calculation on its range. With SUMIFS, use a start date and an end date.

Quarters

For the calendar year, =ROUNDUP(MONTH(A2)/3,0) turns months 1 to 12 into quarters 1 to 4.

For the Indian financial year, April to March, shift the month first: =MOD(MONTH(A2)-4,12) is 0 for April and 11 for March, so the quarter is =INT(MOD(MONTH(A2)-4,12)/3)+1. April to June gives 1, and January to March gives 4.

The financial year

A date from April onwards belongs to the financial year that starts in its own calendar year. A date from January to March belongs to the one that started the year before. The start year is therefore =YEAR(A2)-(MONTH(A2)<4). The second-last example builds the usual label, such as 2025-26, from that.

Birthdays and anniversaries

To find the rows whose day and month match today, compare both parts: =AND(MONTH(B2)=MONTH(TODAY()),DAY(B2)=DAY(TODAY())). For "birthdays this month", the MONTH test alone is enough.

To sort a list of birthdays through the year, ignoring the year of birth, sort by a helper column of =TEXT(B2,"mm-dd").

Rebuilding a date

These functions are the partners of DATE. Take a date apart, change a part, and put it together again: =DATE(YEAR(A2),MONTH(A2),1) is the first day of the same month.

Common mistakes

In Google Sheets

YEAR, MONTH and DAY are the same in Google Sheets.

Related functions

Every result on this page was calculated in Microsoft Excel (version 16.0, build 20326) on 12 November 2026, not typed by hand.

This is an independent help site. It is not connected with or approved by Microsoft. Excel and Microsoft 365 are trademarks of Microsoft Corporation, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.