ElyxAI
formulas

How to Use YEAR, MONTH, DAY Functions

Excel 2016Excel 2019Excel 365Excel Online

Learn to extract year, month, and day components from dates using Excel's YEAR, MONTH, and DAY functions. These essential date functions allow you to break down dates into individual components for analysis, sorting, and reporting. Perfect for financial timelines, project management, and data organization tasks where date components drive insights.

Why This Matters

These functions are crucial for financial reporting, deadline tracking, and date-based analysis in business analytics. They enable automated calculations that would otherwise require manual date manipulation.

Prerequisites

  • Basic understanding of Excel formulas and cell references
  • Familiarity with DATE function or date formats in Excel
  • Knowledge of how to enter formulas in cells

Step-by-Step Instructions

1

Open Excel and create a sample dataset

Launch Excel and create a column with date values. In column A, enter dates (e.g., 15/03/2024). These dates will serve as input for your YEAR, MONTH, and DAY functions.

2

Enter the YEAR function formula

Click cell B1 and type =YEAR(A1), then press Enter. This extracts the year component (e.g., 2024) from the date in cell A1.

3

Enter the MONTH function formula

Click cell C1 and type =MONTH(A1), then press Enter. This extracts the month as a number (e.g., 3 for March) from the date.

4

Enter the DAY function formula

Click cell D1 and type =DAY(A1), then press Enter. This extracts the day of the month (e.g., 15) from the date in cell A1.

5

Copy formulas down to all rows

Select cells B1:D1, then drag the fill handle down or use Ctrl+D to copy formulas to all rows with dates. All date components will now be extracted automatically.

Alternative Methods

Use TEXT function for formatted output

Use =TEXT(A1,"YYYY") for year, =TEXT(A1,"MM") for month, or =TEXT(A1,"DD") for day to get formatted text results directly.

Combine functions for custom date formats

Use =DAY(A1)&"/"&MONTH(A1)&"/"&YEAR(A1) to concatenate components into a custom date format like DD/MM/YYYY.

Tips & Tricks

  • MONTH returns 1-12 (January=1), making it perfect for quarterly analysis or seasonal grouping.
  • DAY function returns 1-31; combine with MONTH to create month-end date calculations.
  • These functions return numbers, not text, so they work perfectly in mathematical operations like SUM or AVERAGE.

Pro Tips

  • Create a fiscal year column with =IF(MONTH(A1)>=4,YEAR(A1),YEAR(A1)-1) for April-based fiscal years.
  • Use =CONCATENATE(DAY(A1)," ",TEXT(MONTH(A1),"mmmm")," ",YEAR(A1)) to generate readable dates like '15 March 2024'.
  • Combine YEAR with COUNTIF to count all transactions from a specific year: =COUNTIF($A$1:$A$100,YEAR(A1)&"*").

Troubleshooting

Formula returns #VALUE! error

Ensure the cell contains a valid date, not text. Format the source column as Date (Home > Number Format > Date) or use DATEVALUE() to convert text to date format.

MONTH returns unexpected numbers

Verify the date format is correct—some regions use DD/MM/YYYY while others use MM/DD/YYYY. Excel interprets dates based on system locale settings.

Functions work in one cell but not when copied

Check that cell references are correct; use absolute references ($A$1) if extracting from the same date column, or relative references (A1) if copying across rows.

Related Excel Formulas

Frequently Asked Questions

Can I extract the day of the week (Monday, Tuesday, etc.)?
No, the DAY function returns only the day of the month (1-31). Use the WEEKDAY function to get the day of the week, or TEXT(A1,"dddd") to display the day name as text.
What happens if I apply YEAR to an empty cell?
The function returns 0 or an error, depending on the formula. Wrap it with IFERROR(YEAR(A1),"") to return a blank cell instead of 0 if the input is empty.
Can these functions handle both date and datetime values?
Yes, YEAR, MONTH, and DAY ignore the time component and extract only the date part. They work seamlessly with datetime formats like '15/03/2024 14:30:00'.
How do I create a date from extracted YEAR, MONTH, and DAY values?
Use the DATE function: =DATE(YEAR(A1), MONTH(A1), DAY(A1)). This reconstructs a date from individual components extracted by the three functions.

This was one task. ElyxAI handles hundreds.

Sign up