ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Dates
  3. YEAR, MONTH and DAY in Excel: Split a Date Into Parts

YEAR, MONTH and DAY in Excel: Split a Date Into Parts

By ExcelReady Team·Updated November 1, 2026·6 min read

The short answer

The YEAR, MONTH and DAY functions in Excel each take one date and return one part of it as a number. For 15 March 2024 in A2, =YEAR(A2) returns 2024, =MONTH(A2) returns 3 and =DAY(A2) returns 15. Put the parts back together, or change them, with DATE: =DATE(YEAR(A2),MONTH(A2),1) gives the first day of that month.

Key takeaways

  • =YEAR(A2), =MONTH(A2) and =DAY(A2) each return one part of a date as a number.
  • DATE(year, month, day) puts the parts back together, and handles months above 12 by rolling into the next year.
  • =DATE(YEAR(A2),MONTH(A2),1) returns the first day of the month.
  • A blank cell gives YEAR 1900, MONTH 1 and DAY 0, so guard formulas against empty rows.
  • If a result looks like a date such as 16/07/1905, change the cell format to General.
On this page+
  1. What do the YEAR, MONTH and DAY functions do?
  2. How to split a date into year, month and day
  3. How to put a date back together with DATE
  4. How to use YEAR and MONTH in other formulas
  5. Why does YEAR, MONTH or DAY give a strange result?
  6. YEAR, MONTH and DAY vs TEXT
  7. Practise it

The YEAR, MONTH and DAY functions in Excel split a date into its three parts, each as a plain number. For 15 March 2024, YEAR returns 2024, MONTH returns 3 and DAY returns 15. This guide shows how to use them, how to put a date back together with DATE, and how to fix the odd results that come from blank cells and wrong formats.

What do the YEAR, MONTH and DAY functions do?#

Each function takes one date and returns one part of it. They all have the same simple shape, with a single argument:

FunctionReturnsRangeExample for 15 March 2024
=YEAR(A2)The year1900 to 99992024
=MONTH(A2)The month number1 to 123
=DAY(A2)The day of the month1 to 3115

The argument is called the serial number, because Excel stores every date as a number that counts days from 1 January 1900. You can point at a cell, use another function like TODAY(), or build a date with DATE. All three functions work in every version of Excel, on Windows and Mac.

For a wider tour of the date toolkit, see the overview of Excel date functions.

How to split a date into year, month and day#

Put each function in its own column and point it at the date. Here is a small orders table:

ABCDE
1OrderDateYearMonthDay
2100115/03/20242024315
3100202/11/20232023112
4100328/02/20242024228
5100409/07/2025202579

The formulas in row 2 are =YEAR(B2), =MONTH(B2) and =DAY(B2). Fill them down (Windows: Ctrl+D; Mac: ⌘D).

Splitting dates like this is useful for filtering and grouping. A Year column lets you filter one year in a single click, and a Month column lets you count orders per month with COUNTIF. For counting without helper columns, see how to count dates by month.

How to put a date back together with DATE#

DATE does the opposite job: it takes a year, a month and a day and returns a real date. The syntax is =DATE(year, month, day), always in that order.

Combine DATE with YEAR, MONTH and DAY to change one part of a date and keep the others:

GoalFormulaResult for 15/03/2024
First day of the month=DATE(YEAR(B2),MONTH(B2),1)01/03/2024
Same date next year=DATE(YEAR(B2)+1,MONTH(B2),DAY(B2))15/03/2025
1 January of that year=DATE(YEAR(B2),1,1)01/01/2024
Same day 3 months later=DATE(YEAR(B2),MONTH(B2)+3,DAY(B2))15/06/2024

DATE handles overflow for you. A month of 13 becomes January of the next year, and a day of 0 becomes the last day of the previous month. So =DATE(2024,3,0) returns 29 February 2024. There's more on this in getting the first and last day of a month.

DATE is also the fix when your data arrives in three separate columns. If A2 holds 2024, B2 holds 3 and C2 holds 15, =DATE(A2,B2,C2) gives a proper date. If day and month have been read the wrong way round, the guide to fixing swapped days and months uses the same functions.

How to use YEAR and MONTH in other formulas#

Use YEAR and MONTH inside IF, SUMPRODUCT or criteria to work with whole years or months. Some practical examples, using the orders table above with amounts in C2:C5 of 250, 120, 400 and 90:

Label each order with its year and quarter:

Excel formula
=YEAR(B2)&"-Q"&ROUNDUP(MONTH(B2)/3,0)

For 15/03/2024 this returns 2024-Q1: MONTH gives 3, and 3 divided by 3, rounded up, is quarter 1.

Sum the amounts for 2024 only:

Excel formula
=SUMPRODUCT((YEAR(B2:B5)=2024)*C2:C5)

YEAR checks each date, the comparison gives TRUE or FALSE, and multiplying by the amounts keeps only the 2024 rows. The result is 250 + 400 = 650.

Count the days in a month:

Excel formula
=DAY(EOMONTH(B2,0))

EOMONTH(B2,0) returns the last day of B2's month. DAY then reads its day number: 29 for February 2024, because 2024 is a leap year.

If your year starts in a month other than January, plain YEAR isn't enough. The guide to getting the fiscal year from a date shows how to shift it.

Why does YEAR, MONTH or DAY give a strange result?#

Strange results usually mean the input isn't a real date or the output has the wrong format. Here are the common cases:

What you seeCauseFix
#VALUE!The date is text Excel can't readConvert it to a real date first
1900 from YEARThe cell is blank=IF(B2="","",YEAR(B2))
0 from DAYThe cell is blankSame IF guard
16/07/1905 instead of 2024The result cell has a date formatFormat the cell as General
Wrong monthDay and month swapped on importRebuild the date with DATE

The blank-cell case is easy to miss. A blank counts as 0, which Excel reads as a date in January 1900. So MONTH of a blank cell returns 1, and a "count by month" formula can quietly add empty rows to January.

To check whether a cell holds a real date, change its format to General. A real date turns into a number like 45366. Text stays as it was.

YEAR, MONTH and DAY vs TEXT#

Use YEAR, MONTH and DAY when you need numbers, and TEXT when you need labels. MONTH returns 3, which you can compare, add to and use in criteria. TEXT(B2,"mmmm") returns the word March, which is text and can't be used in maths.

A good habit: keep the real date in one column, calculate with YEAR, MONTH and DAY, and only turn things into text in the final report column.

Practise it#

Splitting and rebuilding dates is the foundation of almost every date task in a spreadsheet job test. Practise date basics in a live spreadsheet: you'll use DATE, YEAR, MONTH and DAY on real data, and each formula is checked instantly. Or try the exercise on this page first.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

How many days are in the month of each date? Click C2 and find the last day of the month with EOMONTH, then take its day number with DAY.

fx
ABCD
1
Payroll run
Date
Days in month
2
Feb run
45332
3
Apr run
45404
4
Jul run
45478
5
Nov run
45979
6
7
8

Tip: EOMONTH(B2,0) gives the last day of B2's month. DAY then returns its day number.

Practise this in a lesson

LessonHow Excel stores dates: DATE, YEAR, MONTH, DAYLearn why every date is secretly a number, then build dates with DATE and take them apart with YEAR, MONTH and DAY.

Frequently asked questions

How do I extract the year from a date in Excel?

+

Use =YEAR(A2). It returns the year as a four-digit number, such as 2024. The cell must hold a real date, not text that looks like a date.

Why does YEAR return 1900?

+

The cell is empty or holds a small number. Excel treats a blank as day 0 of its calendar, which is in 1900. Check that the cell really holds a date, or wrap the formula in IF(A2="","",YEAR(A2)).

Why does MONTH show a date instead of a number?

+

The result cell has a date format. MONTH returned a number like 3, but the format displays it as a date in January 1900. Change the cell format to General or Number.

How do I combine year, month and day columns into a date?

+

Use DATE with the three cells in order: =DATE(A2,B2,C2), where A2 is the year, B2 the month and C2 the day. The result is a real date you can format and calculate with.

What is the difference between MONTH and TEXT for months?

+

MONTH returns a number from 1 to 12 that you can use in maths and criteria. TEXT(A2,"mmmm") returns the month name as text, which is better for labels.

Sources

  • YEAR function - Microsoft Support
  • MONTH function - Microsoft Support
  • DATE function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What do the YEAR, MONTH and DAY functions do?
  2. How to split a date into year, month and day
  3. How to put a date back together with DATE
  4. How to use YEAR and MONTH in other formulas
  5. Why does YEAR, MONTH or DAY give a strange result?
  6. YEAR, MONTH and DAY vs TEXT
  7. Practise it

Keep reading

Errors & fixes· 5 min read

Excel Swapping Day and Month? How to Fix Dates

Excel swaps day and month when it reads dates written in a different order from your computer's regional settings, for example a day/month CSV opened on a month/day system. Changing the format won't fix it. Re-import with Text to Columns set to DMY, or rebuild each date with DATE, such as =DATE(YEAR(A2),DAY(A2),MONTH(A2)).

Dates· 7 min read

First and Last Day of the Month in Excel

For the first day of the month in Excel, use =EOMONTH(A2,-1)+1: the last day of the previous month plus one day. You can also write =DATE(YEAR(A2),MONTH(A2),1). For the last day of the month, use =EOMONTH(A2,0). Change the month number in EOMONTH to move to next month (1) or last month (-1).

Dates· 6 min read

DATE, YEAR, MONTH and DAY in Excel

The Excel DATE function builds a real date from three numbers: =DATE(year, month, day), always in that order. YEAR, MONTH and DAY do the opposite and pull one part out of a date, like =YEAR(B2). Because Excel stores dates as serial numbers, the results can be added, subtracted and compared.

More on dates

  • YEARFRAC in Excel: Part of a Year Between Two Dates
  • Add Days, Months or Years to a Date in Excel
  • Calculate Age or Years of Service in Excel
  • How to Change the Date Format in Excel
  • How to Convert Text to Dates in Excel
  • How to Count Dates by Month in Excel
All dates articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free